Skip to content

Commit

Permalink
mysql: use llvm on Ventura
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Jan 31, 2025
1 parent b87a2da commit 99a0241
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions Formula/m/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Mysql < Formula
# std::string_view is not fully compatible with the libc++ shipped
# with ventura, so we need to use the LLVM libc++ instead.
on_ventura :or_older do
depends_on "llvm@18"
depends_on "llvm"
fails_with :clang
end

Expand Down Expand Up @@ -73,18 +73,8 @@ def install
# Disable ABI checking
inreplace "cmake/abi_check.cmake", "RUN_ABI_CHECK 1", "RUN_ABI_CHECK 0"
elsif MacOS.version <= :ventura
ENV["CC"] = Formula["llvm@18"].opt_bin/"clang"
ENV["CXX"] = Formula["llvm@18"].opt_bin/"clang++"

# The dependencies need to be explicitly added to the environment
deps.each do |dep|
next if dep.build? || dep.test?

ENV.append "CXXFLAGS", "-I#{dep.to_formula.opt_include}"
ENV.append "LDFLAGS", "-L#{dep.to_formula.opt_lib}"
end

ENV.append "LDFLAGS", "-L#{Formula["llvm@18"].opt_lib}/c++ -L#{Formula["llvm@18"].opt_lib} -lunwind"
ENV.llvm_clang
ENV.append "LDFLAGS", "-L#{Formula["llvm"].opt_lib}/c++ -L#{Formula["llvm"].opt_lib}/unwind -lunwind"
end

icu4c = deps.find { |dep| dep.name.match?(/^icu4c(@\d+)?$/) }
Expand Down Expand Up @@ -115,19 +105,6 @@ def install
-DWITH_UNIT_TESTS=OFF
]

# Add the dependencies to the CMake args
if OS.mac? && MacOS.version <=(:ventura)
args += %W[
-DABSL_INCLUDE_DIR=#{Formula["abseil"].opt_include}
-DICU_ROOT=#{Formula["icu4c@76"].opt_prefix}
-DLZ4_INCLUDE_DIR=#{Formula["lz4"].opt_include}
-DOPENSSL_INCLUDE_DIR=#{Formula["openssl@3"].opt_include}
-DPROTOBUF_INCLUDE_DIR=#{Formula["protobuf"].opt_include}
-DZLIB_INCLUDE_DIR=#{Formula["zlib"].opt_include}
-DZSTD_INCLUDE_DIR=#{Formula["zstd"].opt_include}
]
end

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
Expand Down

0 comments on commit 99a0241

Please sign in to comment.