summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
diff options
context:
space:
mode:
authorMikhail R. Gadelha <mikhail.ramalho@gmail.com>2019-02-07 03:19:45 +0000
committerMikhail R. Gadelha <mikhail.ramalho@gmail.com>2019-02-07 03:19:45 +0000
commiteac500f0c340c00308039fdf5d9deaf3953fccd0 (patch)
treedff87821d09574f7c3ece62f7bf8be00ff2a4638 /llvm/cmake
parent5f16ad9a1be845fef99155278bc5743e357664cd (diff)
downloadbcm5719-llvm-eac500f0c340c00308039fdf5d9deaf3953fccd0.tar.gz
bcm5719-llvm-eac500f0c340c00308039fdf5d9deaf3953fccd0.zip
Move the SMT API to LLVM
Moved everything SMT-related to LLVM and updated the cmake scripts. Differential Revision: https://reviews.llvm.org/D54978 llvm-svn: 353373
Diffstat (limited to 'llvm/cmake')
-rw-r--r--llvm/cmake/modules/FindZ3.cmake51
-rw-r--r--llvm/cmake/modules/LLVMConfig.cmake.in2
2 files changed, 53 insertions, 0 deletions
diff --git a/llvm/cmake/modules/FindZ3.cmake b/llvm/cmake/modules/FindZ3.cmake
new file mode 100644
index 00000000000..5c6d3f0b427
--- /dev/null
+++ b/llvm/cmake/modules/FindZ3.cmake
@@ -0,0 +1,51 @@
+# Looking for Z3 in LLVM_Z3_INSTALL_DIR
+find_path(Z3_INCLUDE_DIR NAMES z3.h
+ NO_DEFAULT_PATH
+ PATHS ${LLVM_Z3_INSTALL_DIR}/include
+ PATH_SUFFIXES libz3 z3
+ )
+
+find_library(Z3_LIBRARIES NAMES z3 libz3
+ NO_DEFAULT_PATH
+ PATHS ${LLVM_Z3_INSTALL_DIR}
+ PATH_SUFFIXES lib bin
+ )
+
+find_program(Z3_EXECUTABLE z3
+ NO_DEFAULT_PATH
+ PATHS ${LLVM_Z3_INSTALL_DIR}
+ PATH_SUFFIXES bin
+ )
+
+# If Z3 has not been found in LLVM_Z3_INSTALL_DIR look in the default directories
+find_path(Z3_INCLUDE_DIR NAMES z3.h
+ PATH_SUFFIXES libz3 z3
+ )
+
+find_library(Z3_LIBRARIES NAMES z3 libz3
+ PATH_SUFFIXES lib bin
+ )
+
+find_program(Z3_EXECUTABLE z3
+ PATH_SUFFIXES bin
+ )
+
+if(Z3_INCLUDE_DIR AND Z3_LIBRARIES AND Z3_EXECUTABLE)
+ execute_process (COMMAND ${Z3_EXECUTABLE} -version
+ OUTPUT_VARIABLE libz3_version_str
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ string(REGEX REPLACE "^Z3 version ([0-9.]+)" "\\1"
+ Z3_VERSION_STRING "${libz3_version_str}")
+ unset(libz3_version_str)
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set Z3_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Z3
+ REQUIRED_VARS Z3_LIBRARIES Z3_INCLUDE_DIR
+ VERSION_VAR Z3_VERSION_STRING)
+
+mark_as_advanced(Z3_INCLUDE_DIR Z3_LIBRARIES)
diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in
index 7ca06381d90..b5576fda6ae 100644
--- a/llvm/cmake/modules/LLVMConfig.cmake.in
+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
@@ -44,6 +44,8 @@ set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)
set(LLVM_LIBXML2_ENABLED @LLVM_LIBXML2_ENABLED@)
+set(LLVM_WITH_Z3 @LLVM_WITH_Z3@)
+
set(LLVM_ENABLE_DIA_SDK @LLVM_ENABLE_DIA_SDK@)
set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
OpenPOWER on IntegriCloud