summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDominic Chen <d.c.ddcc@gmail.com>2017-04-04 19:52:25 +0000
committerDominic Chen <d.c.ddcc@gmail.com>2017-04-04 19:52:25 +0000
commitfe95f3ca3634529cecfe3dddb88095c273e36722 (patch)
treeaada8dbed7495102a2599e91fc01fb36cf8fbe80 /CMakeLists.txt
parenta64aac47da8b3bf66b2fd3cf973508a8ce7d23a8 (diff)
[analyzer] Add new Z3 constraint manager backend
Summary: Implement new Z3 constraint manager backend. Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D28952 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 19 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a095d2b865..ca696b1ce7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,6 +186,8 @@ 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)
@@ -330,10 +332,6 @@ if (APPLE)
endif()
endif()
-configure_file(
- ${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake
- ${CLANG_BINARY_DIR}/include/clang/Config/config.h)
-
include(CMakeParseArguments)
include(AddClang)
@@ -371,8 +369,19 @@ option(CLANG_BUILD_TOOLS
option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
option(CLANG_ENABLE_STATIC_ANALYZER "Build static analyzer." ON)
-if (NOT CLANG_ENABLE_STATIC_ANALYZER AND CLANG_ENABLE_ARCMT)
- message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT")
+option(CLANG_ANALYZER_BUILD_Z3
+ "Build the static analyzer with the Z3 constraint manager." OFF)
+
+if(NOT CLANG_ENABLE_STATIC_ANALYZER AND (CLANG_ENABLE_ARCMT OR CLANG_ANALYZER_BUILD_Z3))
+ message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT or Z3")
+endif()
+
+if(CLANG_ANALYZER_BUILD_Z3)
+ if(Z3_FOUND)
+ set(CLANG_ANALYZER_WITH_Z3 1)
+ else()
+ message(FATAL_ERROR "Cannot find Z3 header file or shared library")
+ endif()
endif()
if(CLANG_ENABLE_ARCMT)
@@ -687,3 +696,7 @@ endif()
if (LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
add_subdirectory(utils/ClangVisualizers)
endif()
+
+configure_file(
+ ${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake
+ ${CLANG_BINARY_DIR}/include/clang/Config/config.h)