[PATCH] D75544: Change CMake so that we only look for Z3 when LLVM_ENABLE_Z3_SOLVER is enabled

Mikhail Ramalho via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 12:21:43 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGfb34345e363a: Change CMake so that we only look for Z3 when LLVM_ENABLE_Z3_SOLVER is enabled (authored by hcorion, committed by mikhail.ramalho).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75544/new/

https://reviews.llvm.org/D75544

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -368,22 +368,20 @@
 
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
 
-find_package(Z3 4.7.1)
-
-if (LLVM_Z3_INSTALL_DIR)
-  if (NOT Z3_FOUND)
-    message(FATAL_ERROR "Z3 >= 4.7.1 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.")
-  endif()
-endif()
-
-set(LLVM_ENABLE_Z3_SOLVER_DEFAULT "${Z3_FOUND}")
-
 option(LLVM_ENABLE_Z3_SOLVER
   "Enable Support for the Z3 constraint solver in LLVM."
   ${LLVM_ENABLE_Z3_SOLVER_DEFAULT}
 )
 
 if (LLVM_ENABLE_Z3_SOLVER)
+  find_package(Z3 4.7.1)
+  
+  if (LLVM_Z3_INSTALL_DIR)
+    if (NOT Z3_FOUND)
+      message(FATAL_ERROR "Z3 >= 4.7.1 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.")
+    endif()
+  endif()
+  
   if (NOT Z3_FOUND)
     message(FATAL_ERROR "LLVM_ENABLE_Z3_SOLVER cannot be enabled when Z3 is not available.")
   endif()
@@ -391,6 +389,9 @@
   set(LLVM_WITH_Z3 1)
 endif()
 
+set(LLVM_ENABLE_Z3_SOLVER_DEFAULT "${Z3_FOUND}")
+
+
 if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
   set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75544.272794.patch
Type: text/x-patch
Size: 1217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200623/516c9843/attachment-0001.bin>


More information about the llvm-commits mailing list