]> granicus.if.org Git - clang/commitdiff
CMake: only try to find the Z3 package when `CLANG_ANALYZER_BUILD_Z3` is ON
authorMehdi Amini <joker.eph@gmail.com>
Sun, 27 Aug 2017 20:24:23 +0000 (20:24 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 27 Aug 2017 20:24:23 +0000 (20:24 +0000)
This avoids the spurious message:

 Could NOT find Z3 (missing:  Z3_LIBRARIES Z3_INCLUDE_DIR) (Required is at least version "4.5")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311858 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index c1da2cff1b14689f4b2bc7fcf595d66401833b2c..a4a0c2c63b7f142233e99e65f6aed0e3a8aa1327 100644 (file)
@@ -187,8 +187,6 @@ if (LIBXML2_FOUND)
   set(CLANG_HAVE_LIBXML 1)
 endif()
 
-find_package(Z3 4.5)
-
 include(CheckIncludeFile)
 check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)
 
@@ -384,6 +382,7 @@ if(NOT CLANG_ENABLE_STATIC_ANALYZER AND (CLANG_ENABLE_ARCMT OR CLANG_ANALYZER_BU
 endif()
 
 if(CLANG_ANALYZER_BUILD_Z3)
+  find_package(Z3 4.5)
   if(Z3_FOUND)
     set(CLANG_ANALYZER_WITH_Z3 1)
   else()