cmake: also check Homebrew install paths when looking for LLVM

- On Intel Macs, the path is /usr/local/opt/llvm@12
- On Silicon Macs, the path is /opt/homebrew/opt/llvm@12

This makes specifying CMAKE_PREFIX_PATH optional for Homebrew LLVM.
This commit is contained in:
FnControlOption
2021-07-18 16:54:43 -07:00
committed by Andrew Kelley
parent 175d95b591
commit 23c25c5eaf
3 changed files with 18 additions and 0 deletions

View File

@@ -14,6 +14,8 @@ find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
/usr/lib/llvm-12.0/include
/usr/local/llvm12/include
/usr/local/llvm120/include
/usr/local/opt/llvm@12/include
/opt/homebrew/opt/llvm@12/include
/mingw64/include
)
@@ -31,6 +33,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
/usr/lib/llvm-12/lib
/usr/local/llvm12/lib
/usr/local/llvm120/lib
/usr/local/opt/llvm@12/lib
/opt/homebrew/opt/llvm@12/lib
)
find_program(LLVM_CONFIG_EXE
@@ -185,6 +189,8 @@ else()
/usr/lib/llvm-12.0/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
/usr/local/opt/llvm@12/lib
/opt/homebrew/opt/llvm@12/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib)