build: simplify llvm-config provided system library parsing

- Revert the addition of CLANG_SYSTEM_LIBARIES and LLVM_SYSTEM_LIBRARIES
- Change addCMakeLibraryList to parse non-absolute path .lib dependencies as system libraries
This commit is contained in:
kcbanner
2023-01-04 02:18:51 -05:00
parent f5135f8e3b
commit 3cacbea95b
5 changed files with 11 additions and 49 deletions

View File

@@ -5,7 +5,6 @@
# CLANG_FOUND
# CLANG_INCLUDE_DIRS
# CLANG_LIBRARIES
# CLANG_SYSTEM_LIBRARIES
# CLANG_LIBDIRS
find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
@@ -70,7 +69,7 @@ else()
endif()
if (MSVC)
set(CLANG_SYSTEM_LIBRARIES "version.lib")
set(CLANG_LIBRARIES ${CLANG_LIBRARIES} "version.lib")
endif()
include(FindPackageHandleStandardArgs)

View File

@@ -5,7 +5,6 @@
# LLVM_FOUND
# LLVM_INCLUDE_DIRS
# LLVM_LIBRARIES
# LLVM_SYSTEM_LIBRARIES
# LLVM_LIBDIRS
# LLVM_LINK_MODE
@@ -173,9 +172,9 @@ if(ZIG_USE_LLVM_CONFIG)
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_STATIC_SYSTEM_LIBS "${LLVM_STATIC_SYSTEM_LIBS_SPACES}")
set(LLVM_SYSTEM_LIBRARIES ${LLVM_SYSTEM_LIBS} ${LLVM_STATIC_SYSTEM_LIBS})
set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS} ${LLVM_STATIC_SYSTEM_LIBS})
else()
set(LLVM_SYSTEM_LIBRARIES ${LLVM_SYSTEM_LIBS})
set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
endif()
execute_process(
@@ -370,11 +369,7 @@ else()
find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h)
endif()
if(NOT LLVM_SYSTEM_LIBRARIES)
set(LLVM_SYSTEM_LIBRARIES "")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(llvm DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS)
mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_SYSTEM_LIBRARIES LLVM_LIBDIRS)
mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIRS)