[PATCH] D132870: tweak zstd behavior in cmake and llvm config for better testing
Cole Kissane via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 29 10:27:34 PDT 2022
ckissane created this revision.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: All.
ckissane requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
propagate variable zstd_DIR in LLVMConfig.cmake.in
fix llvm-config CMakeLists.txt behavior for absolute libs windows
get zstd lib name
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D132870
Files:
llvm/cmake/modules/LLVMConfig.cmake.in
llvm/lib/Support/CMakeLists.txt
llvm/tools/llvm-config/CMakeLists.txt
Index: llvm/tools/llvm-config/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-config/CMakeLists.txt
+++ llvm/tools/llvm-config/CMakeLists.txt
@@ -17,9 +17,14 @@
# Compute the substitution values for various items.
get_property(SUPPORT_SYSTEM_LIBS TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
get_property(WINDOWSMANIFEST_SYSTEM_LIBS TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS)
+
foreach(l ${SUPPORT_SYSTEM_LIBS} ${WINDOWSMANIFEST_SYSTEM_LIBS})
if(MSVC)
- set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}.lib")
+ if(IS_ABSOLUTE ${l})
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
+ else()
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}.lib")
+ endif()
else()
if (l MATCHES "^-")
# If it's an option, pass it without changes.
@@ -34,6 +39,7 @@
endif()
endif()
endforeach()
+
string(REPLACE ";" " " SYSTEM_LIBS "${SYSTEM_LIBS}")
# Fetch target specific compile options, e.g. RTTI option
Index: llvm/lib/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Support/CMakeLists.txt
+++ llvm/lib/Support/CMakeLists.txt
@@ -21,8 +21,10 @@
endif()
endif()
+set(imported_libs "")
+
if(LLVM_ENABLE_ZLIB)
- set(imported_libs ZLIB::ZLIB)
+ list(APPEND imported_libs ZLIB::ZLIB)
endif()
if(LLVM_ENABLE_ZSTD)
@@ -305,6 +307,7 @@
if(NOT zstd_library)
get_property(zstd_library TARGET zstd::libzstd_shared PROPERTY LOCATION)
endif()
+ get_library_name(${zstd_library} zstd_library)
set(llvm_system_libs ${llvm_system_libs} "${zstd_library}")
endif()
Index: llvm/cmake/modules/LLVMConfig.cmake.in
===================================================================
--- llvm/cmake/modules/LLVMConfig.cmake.in
+++ llvm/cmake/modules/LLVMConfig.cmake.in
@@ -75,7 +75,7 @@
set(LLVM_ENABLE_ZSTD @LLVM_ENABLE_ZSTD@)
if(LLVM_ENABLE_ZSTD)
- set(zstd_ROOT @zstd_ROOT@)
+ set(zstd_DIR @zstd_DIR@)
find_package(zstd)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132870.456401.patch
Type: text/x-patch
Size: 1988 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220829/f8d5aeae/attachment.bin>
More information about the llvm-commits
mailing list