CMake: only try to find the Z3 package when `CLANG_ANALYZER_BUILD_Z3` is ON

This avoids the spurious message:

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

llvm-svn: 311858
This commit is contained in:
Mehdi Amini 2017-08-27 20:24:23 +00:00
parent f23847604b
commit 8e8f25b1a5
1 changed files with 1 additions and 2 deletions

View 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()