Meta: Teach pick_host_compiler about Homebrew Clang

Homebrew does not add upstream LLVM's install location to $PATH so as
not to conflict with XCode tools, so we should look for it by its
absolute path. LLVM is installed to /opt/homebrew/opt/llvm on ARM Macs,
and is a symlink that points to the latest stable LLVM version.
This commit is contained in:
Daniel Bertalan 2022-07-10 09:21:50 +02:00 committed by Linus Groh
parent 710fb11c73
commit 5c3b182b7e
Notes: sideshowbarker 2024-07-17 09:33:24 +09:00

View file

@ -199,7 +199,7 @@ pick_host_compiler() {
return
fi
find_newest_compiler clang clang-13 clang-14 clang-15
find_newest_compiler clang clang-13 clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang
if is_supported_compiler "$HOST_COMPILER"; then
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$HOST_COMPILER")
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${HOST_COMPILER/clang/clang++}")