authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-25 20:26:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-25 20:26:14-07:00
log9c3bd437e66b4b4e0d1b093e988229e9a6135d36
treecb776ad7ed8d641953f74f80c89f58582df956bf
parent96a55f6ce86dc2e25c275ee3211b2cde0e3d92ab

update cmake files to LLVM 16


4 files changed, 28 insertions(+), 28 deletions(-)

CMakeLists.txt+3-3
......@@ -127,9 +127,9 @@ if(ZIG_AR_WORKAROUND)
127127 string(REPLACE "<CMAKE_AR>" "<CMAKE_AR> ar" CMAKE_CXX_ARCHIVE_CREATE ${CMAKE_CXX_ARCHIVE_CREATE})
128128endif()
129129
130find_package(llvm 15)
131find_package(clang 15)
132find_package(lld 15)
130find_package(llvm 16)
131find_package(clang 16)
132find_package(lld 16)
133133
134134if(ZIG_STATIC_ZLIB)
135135 if (MSVC)
cmake/Findclang.cmake+3-3
......@@ -17,9 +17,9 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1717if(${LLVM_LINK_MODE} STREQUAL "shared")
1818 find_library(CLANG_LIBRARIES
1919 NAMES
20 libclang-cpp.so.15
21 clang-cpp-15.0
22 clang-cpp150
20 libclang-cpp.so.16
21 clang-cpp-16.0
22 clang-cpp160
2323 clang-cpp
2424 NAMES_PER_DIR
2525 HINTS "${LLVM_LIBDIRS}"
cmake/Findlld.cmake+16-16
......@@ -9,21 +9,21 @@
99find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1010 HINTS ${LLVM_INCLUDE_DIRS}
1111 PATHS
12 /usr/lib/llvm-15/include
13 /usr/local/llvm150/include
14 /usr/local/llvm15/include
15 /usr/local/opt/llvm@15/include
16 /opt/homebrew/opt/llvm@15/include
12 /usr/lib/llvm-16/include
13 /usr/local/llvm160/include
14 /usr/local/llvm16/include
15 /usr/local/opt/llvm@16/include
16 /opt/homebrew/opt/llvm@16/include
1717 /mingw64/include)
1818
19find_library(LLD_LIBRARY NAMES lld-15.0 lld150 lld NAMES_PER_DIR
19find_library(LLD_LIBRARY NAMES lld-16.0 lld160 lld NAMES_PER_DIR
2020 HINTS ${LLVM_LIBDIRS}
2121 PATHS
22 /usr/lib/llvm-15/lib
23 /usr/local/llvm150/lib
24 /usr/local/llvm15/lib
25 /usr/local/opt/llvm@15/lib
26 /opt/homebrew/opt/llvm@15/lib
22 /usr/lib/llvm-16/lib
23 /usr/local/llvm160/lib
24 /usr/local/llvm16/lib
25 /usr/local/opt/llvm@16/lib
26 /opt/homebrew/opt/llvm@16/lib
2727)
2828if(EXISTS ${LLD_LIBRARY})
2929 set(LLD_LIBRARIES ${LLD_LIBRARY})
......@@ -34,11 +34,11 @@ else()
3434 HINTS ${LLVM_LIBDIRS}
3535 PATHS
3636 ${LLD_LIBDIRS}
37 /usr/lib/llvm-15/lib
38 /usr/local/llvm150/lib
39 /usr/local/llvm15/lib
40 /usr/local/opt/llvm@15/lib
41 /opt/homebrew/opt/llvm@15/lib
37 /usr/lib/llvm-16/lib
38 /usr/local/llvm160/lib
39 /usr/local/llvm16/lib
40 /usr/local/opt/llvm@16/lib
41 /opt/homebrew/opt/llvm@16/lib
4242 /mingw64/lib
4343 /c/msys64/mingw64/lib
4444 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+6-6
......@@ -14,12 +14,12 @@ if(ZIG_USE_LLVM_CONFIG)
1414 while(1)
1515 unset(LLVM_CONFIG_EXE CACHE)
1616 find_program(LLVM_CONFIG_EXE
17 NAMES llvm-config-15 llvm-config-15.0 llvm-config150 llvm-config15 llvm-config NAMES_PER_DIR
17 NAMES llvm-config-16 llvm-config-16.0 llvm-config160 llvm-config16 llvm-config NAMES_PER_DIR
1818 PATHS
1919 "/mingw64/bin"
2020 "/c/msys64/mingw64/bin"
2121 "c:/msys64/mingw64/bin"
22 "C:/Libraries/llvm-15.0.0/bin")
22 "C:/Libraries/llvm-16.0.0/bin")
2323
2424 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
2525 if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
......@@ -37,9 +37,9 @@ if(ZIG_USE_LLVM_CONFIG)
3737 OUTPUT_STRIP_TRAILING_WHITESPACE)
3838
3939 get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
40 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 15 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 16 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 16)
40 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 16 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 17 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 17)
4141 # Save the error message, in case this is the last llvm-config we find
42 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 15.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
42 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 16.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
4343
4444 # Ignore this directory and try the search again
4545 list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
......@@ -63,9 +63,9 @@ if(ZIG_USE_LLVM_CONFIG)
6363 if (LLVM_CONFIG_ERROR)
6464 # Save the error message, in case this is the last llvm-config we find
6565 if (ZIG_SHARED_LLVM)
66 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 15.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
66 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 16.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
6767 else()
68 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 15.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
68 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 16.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
6969 endif()
7070
7171 # Ignore this directory and try the search again