authorgravatar for fncontroloption@noreply.codeberg.orgFnControlOption <fncontroloption@noreply.codeberg.org> 2021-07-18 16:54:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-08 13:48:16-04:00
log23c25c5eaf959549e2f8e090a6c0eae7cfa6cb30
tree31f3c92a95f2dfb3a61d71872ba19f3e12aa8976
parent175d95b59165e3455bc05f0d328a7f86cedb307e

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.

3 files changed, 18 insertions(+), 0 deletions(-)

cmake/Findclang.cmake+6
......@@ -14,6 +14,8 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1414 /usr/lib/llvm-12.0/include
1515 /usr/local/llvm120/include
1616 /usr/local/llvm12/include
17 /usr/local/opt/llvm@12/include
18 /opt/homebrew/opt/llvm@12/include
1719 /mingw64/include
1820)
1921
......@@ -30,6 +32,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
3032 /usr/lib/llvm-12/lib
3133 /usr/local/llvm120/lib
3234 /usr/local/llvm12/lib
35 /usr/local/opt/llvm@12/lib
36 /opt/homebrew/opt/llvm@12/lib
3337 )
3438endif()
3539
......@@ -44,6 +48,8 @@ if(NOT CLANG_LIBRARIES)
4448 /usr/lib/llvm-12.0/lib
4549 /usr/local/llvm120/lib
4650 /usr/local/llvm12/lib
51 /usr/local/opt/llvm@12/lib
52 /opt/homebrew/opt/llvm@12/lib
4753 /mingw64/lib
4854 /c/msys64/mingw64/lib
4955 c:\\msys64\\mingw64\\lib
cmake/Findlld.cmake+6
......@@ -11,6 +11,8 @@ find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1111 /usr/lib/llvm-12/include
1212 /usr/local/llvm120/include
1313 /usr/local/llvm12/include
14 /usr/local/opt/llvm@12/include
15 /opt/homebrew/opt/llvm@12/include
1416 /mingw64/include)
1517
1618find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
......@@ -18,6 +20,8 @@ find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
1820 /usr/lib/llvm-12/lib
1921 /usr/local/llvm120/lib
2022 /usr/local/llvm12/lib
23 /usr/local/opt/llvm@12/lib
24 /opt/homebrew/opt/llvm@12/lib
2125)
2226if(EXISTS ${LLD_LIBRARY})
2327 set(LLD_LIBRARIES ${LLD_LIBRARY})
......@@ -30,6 +34,8 @@ else()
3034 /usr/lib/llvm-12/lib
3135 /usr/local/llvm120/lib
3236 /usr/local/llvm12/lib
37 /usr/local/opt/llvm@12/lib
38 /opt/homebrew/opt/llvm@12/lib
3339 /mingw64/lib
3440 /c/msys64/mingw64/lib
3541 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+6
......@@ -14,6 +14,8 @@ find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
1414 /usr/lib/llvm-12.0/include
1515 /usr/local/llvm12/include
1616 /usr/local/llvm120/include
17 /usr/local/opt/llvm@12/include
18 /opt/homebrew/opt/llvm@12/include
1719 /mingw64/include
1820)
1921
......@@ -31,6 +33,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
3133 /usr/lib/llvm-12/lib
3234 /usr/local/llvm12/lib
3335 /usr/local/llvm120/lib
36 /usr/local/opt/llvm@12/lib
37 /opt/homebrew/opt/llvm@12/lib
3438 )
3539
3640 find_program(LLVM_CONFIG_EXE
......@@ -185,6 +189,8 @@ else()
185189 /usr/lib/llvm-12.0/lib
186190 /usr/local/llvm120/lib
187191 /usr/local/llvm12/lib
192 /usr/local/opt/llvm@12/lib
193 /opt/homebrew/opt/llvm@12/lib
188194 /mingw64/lib
189195 /c/msys64/mingw64/lib
190196 c:\\msys64\\mingw64\\lib)