Inside a Formula, how to properly refer to "/usr/local/opt/llvm@11/bin/clang"? #2218
-
I am working on packaging C2FFI and have successfully built it: rpav/c2ffi#100. However, I am not sure how to specify the path This is what I have so far: class C2ffi < Formula
...
def install
system(
{LDFLAGS => "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"},
"cmake", "-S", ".", "-B", "build",
*std_cmake_args,
"-DBUILD_CONFIG=Release",
"-DCMAKE_PREFIX_PATH=/usr/local/opt/llvm@11",
-"DCMAKE_C_COMPILER=/usr/local/opt/llvm@11/bin/clang",
"-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@11/bin/clang++",
)
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
...
end The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Try Formula["llvm@11"].opt_bin/"clang" You shouldn't need to set |
Beta Was this translation helpful? Give feedback.
Try
You shouldn't need to set
CMAKE_PREFIX_PATH
, asbrew
sets this for you during the build based on the formula's dependencies.