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...@@ -14,6 +14,8 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
14 /usr/lib/llvm-12.0/include14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm120/include15 /usr/local/llvm120/include
16 /usr/local/llvm12/include16 /usr/local/llvm12/include
17 /usr/local/opt/llvm@12/include
18 /opt/homebrew/opt/llvm@12/include
17 /mingw64/include19 /mingw64/include
18)20)
1921
...@@ -30,6 +32,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)...@@ -30,6 +32,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
30 /usr/lib/llvm-12/lib32 /usr/lib/llvm-12/lib
31 /usr/local/llvm120/lib33 /usr/local/llvm120/lib
32 /usr/local/llvm12/lib34 /usr/local/llvm12/lib
35 /usr/local/opt/llvm@12/lib
36 /opt/homebrew/opt/llvm@12/lib
33 )37 )
34endif()38endif()
3539
...@@ -44,6 +48,8 @@ if(NOT CLANG_LIBRARIES)...@@ -44,6 +48,8 @@ if(NOT CLANG_LIBRARIES)
44 /usr/lib/llvm-12.0/lib48 /usr/lib/llvm-12.0/lib
45 /usr/local/llvm120/lib49 /usr/local/llvm120/lib
46 /usr/local/llvm12/lib50 /usr/local/llvm12/lib
51 /usr/local/opt/llvm@12/lib
52 /opt/homebrew/opt/llvm@12/lib
47 /mingw64/lib53 /mingw64/lib
48 /c/msys64/mingw64/lib54 /c/msys64/mingw64/lib
49 c:\\msys64\\mingw64\\lib55 c:\\msys64\\mingw64\\lib
cmake/Findlld.cmake+6
...@@ -11,6 +11,8 @@ find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h...@@ -11,6 +11,8 @@ find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
11 /usr/lib/llvm-12/include11 /usr/lib/llvm-12/include
12 /usr/local/llvm120/include12 /usr/local/llvm120/include
13 /usr/local/llvm12/include13 /usr/local/llvm12/include
14 /usr/local/opt/llvm@12/include
15 /opt/homebrew/opt/llvm@12/include
14 /mingw64/include)16 /mingw64/include)
1517
16find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld18find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
...@@ -18,6 +20,8 @@ find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld...@@ -18,6 +20,8 @@ find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
18 /usr/lib/llvm-12/lib20 /usr/lib/llvm-12/lib
19 /usr/local/llvm120/lib21 /usr/local/llvm120/lib
20 /usr/local/llvm12/lib22 /usr/local/llvm12/lib
23 /usr/local/opt/llvm@12/lib
24 /opt/homebrew/opt/llvm@12/lib
21)25)
22if(EXISTS ${LLD_LIBRARY})26if(EXISTS ${LLD_LIBRARY})
23 set(LLD_LIBRARIES ${LLD_LIBRARY})27 set(LLD_LIBRARIES ${LLD_LIBRARY})
...@@ -30,6 +34,8 @@ else()...@@ -30,6 +34,8 @@ else()
30 /usr/lib/llvm-12/lib34 /usr/lib/llvm-12/lib
31 /usr/local/llvm120/lib35 /usr/local/llvm120/lib
32 /usr/local/llvm12/lib36 /usr/local/llvm12/lib
37 /usr/local/opt/llvm@12/lib
38 /opt/homebrew/opt/llvm@12/lib
33 /mingw64/lib39 /mingw64/lib
34 /c/msys64/mingw64/lib40 /c/msys64/mingw64/lib
35 c:/msys64/mingw64/lib)41 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+6
...@@ -14,6 +14,8 @@ find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h...@@ -14,6 +14,8 @@ find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
14 /usr/lib/llvm-12.0/include14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm12/include15 /usr/local/llvm12/include
16 /usr/local/llvm120/include16 /usr/local/llvm120/include
17 /usr/local/opt/llvm@12/include
18 /opt/homebrew/opt/llvm@12/include
17 /mingw64/include19 /mingw64/include
18)20)
1921
...@@ -31,6 +33,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)...@@ -31,6 +33,8 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
31 /usr/lib/llvm-12/lib33 /usr/lib/llvm-12/lib
32 /usr/local/llvm12/lib34 /usr/local/llvm12/lib
33 /usr/local/llvm120/lib35 /usr/local/llvm120/lib
36 /usr/local/opt/llvm@12/lib
37 /opt/homebrew/opt/llvm@12/lib
34 )38 )
3539
36 find_program(LLVM_CONFIG_EXE40 find_program(LLVM_CONFIG_EXE
...@@ -185,6 +189,8 @@ else()...@@ -185,6 +189,8 @@ else()
185 /usr/lib/llvm-12.0/lib189 /usr/lib/llvm-12.0/lib
186 /usr/local/llvm120/lib190 /usr/local/llvm120/lib
187 /usr/local/llvm12/lib191 /usr/local/llvm12/lib
192 /usr/local/opt/llvm@12/lib
193 /opt/homebrew/opt/llvm@12/lib
188 /mingw64/lib194 /mingw64/lib
189 /c/msys64/mingw64/lib195 /c/msys64/mingw64/lib
190 c:\\msys64\\mingw64\\lib)196 c:\\msys64\\mingw64\\lib)