[llvm] 30967e5 - Add Z3 to system libraries list if enabled

Mikhail R. Gadelha via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 19:33:05 PDT 2020


Author: Mikhail R. Gadelha
Date: 2020-08-25T22:32:36-04:00
New Revision: 30967e51da614fc814f439a925fabbb12f223919

URL: https://github.com/llvm/llvm-project/commit/30967e51da614fc814f439a925fabbb12f223919
DIFF: https://github.com/llvm/llvm-project/commit/30967e51da614fc814f439a925fabbb12f223919.diff

LOG: Add Z3 to system libraries list if enabled

Without this trying to link static LLVM libraries (built with Z3 enabled) fails because `llvm-config` doesn't print `-lz3`.
We are already using this patch at MSYS2: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-clang/0013-Add-Z3-to-system-libraries-list-if-enabled.patch

Reviewed By: mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D85195

Added: 
    

Modified: 
    llvm/lib/Support/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index a571d269b39f..2da2f203a283 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -57,9 +57,7 @@ endif()
 
 # Link Z3 if the user wants to build it.
 if(LLVM_WITH_Z3)
-  set(Z3_LINK_FILES ${Z3_LIBRARIES})
-else()
-  set(Z3_LINK_FILES "")
+  set(system_libs ${system_libs} ${Z3_LIBRARIES})
 endif()
 
 add_llvm_component_library(LLVMSupport
@@ -206,7 +204,7 @@ add_llvm_component_library(LLVMSupport
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
   ${Backtrace_INCLUDE_DIRS}
-  LINK_LIBS ${system_libs} ${imported_libs} ${delayload_flags} ${Z3_LINK_FILES}
+  LINK_LIBS ${system_libs} ${imported_libs} ${delayload_flags}
   )
 
 set(llvm_system_libs ${system_libs})


        


More information about the llvm-commits mailing list