Update LLVM version numbers in CMake

This commit is contained in:
Jakub Konka 2020-12-16 09:37:32 +01:00
parent b3c1ced2c3
commit 9c2d8056ce
3 changed files with 62 additions and 62 deletions

View File

@ -9,27 +9,27 @@
find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
PATHS
/usr/lib/llvm/11/include
/usr/lib/llvm-11/include
/usr/lib/llvm-11.0/include
/usr/local/llvm110/include
/usr/local/llvm11/include
/usr/lib/llvm/12/include
/usr/lib/llvm-12/include
/usr/lib/llvm-12.0/include
/usr/local/llvm120/include
/usr/local/llvm12/include
/mingw64/include
)
if(ZIG_PREFER_CLANG_CPP_DYLIB)
find_library(CLANG_LIBRARIES
NAMES
clang-cpp-11.0
clang-cpp110
clang-cpp-12.0
clang-cpp120
clang-cpp
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm/11/lib
/usr/lib/llvm/11/lib64
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/usr/lib/llvm/12/lib
/usr/lib/llvm/12/lib64
/usr/lib/llvm-12/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
)
endif()
@ -39,11 +39,11 @@ if(NOT CLANG_LIBRARIES)
find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm/11/lib
/usr/lib/llvm-11/lib
/usr/lib/llvm-11.0/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/usr/lib/llvm/12/lib
/usr/lib/llvm-12/lib
/usr/lib/llvm-12.0/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib

View File

@ -8,16 +8,16 @@
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
PATHS
/usr/lib/llvm-11/include
/usr/local/llvm110/include
/usr/local/llvm11/include
/usr/lib/llvm-12/include
/usr/local/llvm120/include
/usr/local/llvm12/include
/mingw64/include)
find_library(LLD_LIBRARY NAMES lld-11.0 lld110 lld
find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
PATHS
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/usr/lib/llvm-12/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
)
if(EXISTS ${LLD_LIBRARY})
set(LLD_LIBRARIES ${LLD_LIBRARY})
@ -27,9 +27,9 @@ else()
find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${LLD_LIBDIRS}
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/usr/lib/llvm-12/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:/msys64/mingw64/lib)

View File

@ -9,37 +9,37 @@
find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
PATHS
/usr/lib/llvm/11/include
/usr/lib/llvm-11/include
/usr/lib/llvm-11.0/include
/usr/local/llvm11/include
/usr/local/llvm110/include
/usr/lib/llvm/12/include
/usr/lib/llvm-12/include
/usr/lib/llvm-12.0/include
/usr/local/llvm12/include
/usr/local/llvm120/include
/mingw64/include
)
if(ZIG_PREFER_CLANG_CPP_DYLIB)
find_library(LLVM_LIBRARIES
NAMES
LLVM-11.0
LLVM-11
LLVM-110
LLVM-12.0
LLVM-12
LLVM-120
LLVM
PATHS
${LLVM_LIBDIRS}
/usr/lib/llvm/11/lib
/usr/lib/llvm/11/lib64
/usr/lib/llvm-11/lib
/usr/local/llvm11/lib
/usr/local/llvm110/lib
/usr/lib/llvm/12/lib
/usr/lib/llvm/12/lib64
/usr/lib/llvm-12/lib
/usr/local/llvm12/lib
/usr/local/llvm120/lib
)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config
NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
PATHS
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-11.0.0/bin")
"C:/Libraries/llvm-12.0.0/bin")
if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
message(FATAL_ERROR "unable to find llvm-config")
@ -54,23 +54,23 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
OUTPUT_VARIABLE LLVM_CONFIG_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
elseif(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config
NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
PATHS
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-11.0.0/bin")
"C:/Libraries/llvm-12.0.0/bin")
if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
message(FATAL_ERROR "unable to find llvm-config")
@ -85,14 +85,14 @@ elseif(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
OUTPUT_VARIABLE LLVM_CONFIG_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
endif()
execute_process(
@ -166,7 +166,7 @@ elseif(("${ZIG_TARGET_TRIPLE}" STREQUAL "native") OR ZIG_PREFER_LLVM_CONFIG)
set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
if(NOT LLVM_LIBRARIES)
find_library(LLVM_LIBRARIES NAMES LLVM LLVM-11 LLVM-11.0)
find_library(LLVM_LIBRARIES NAMES LLVM LLVM-12 LLVM-12.0)
endif()
link_directories("${CMAKE_PREFIX_PATH}/lib")
@ -180,11 +180,11 @@ else()
find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${LLVM_LIBDIRS}
/usr/lib/llvm/11/lib
/usr/lib/llvm-11/lib
/usr/lib/llvm-11.0/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/usr/lib/llvm/12/lib
/usr/lib/llvm-12/lib
/usr/lib/llvm-12.0/lib
/usr/local/llvm120/lib
/usr/local/llvm12/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib)