about summary refs log tree commit diff homepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2020-09-04 22:04:57 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2020-10-12 11:19:24 +0100
commit9c445a83bc03ca4a0335e98704feee44183831a6 (patch)
tree868034bc5ed0406a6bced20f30340146ca079b50 /CMakeLists.txt
parente94d9c6268cb75ff317a42e26f33c419e6686b5d (diff)
downloadklee-9c445a83bc03ca4a0335e98704feee44183831a6.tar.gz
Exception handling only for LLVM >= 8.0.0
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 916c2d74..1fa4fcc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -705,6 +705,28 @@ else()
 endif()
 
 ################################################################################
+# KLEE Exception Handling Support for C++
+################################################################################
+option(ENABLE_KLEE_EH_CXX "Enable support for C++ Exceptions" OFF)
+if (ENABLE_KLEE_EH_CXX)
+  if (NOT ENABLE_KLEE_LIBCXX)
+    message(FATAL_ERROR "C++ Exception support requires klee-libcxx."
+      "Pass `-DENABLE_KLEE_LIBCXX=ON` to enable it.")
+  endif()
+
+  if (${LLVM_VERSION_MAJOR} GREATER 8 OR ${LLVM_VERSION_MAJOR} EQUAL 8)
+    set(SUPPORT_KLEE_EH_CXX 1) # For config.h
+    message(STATUS "Support for C++ Exceptions enabled")
+  else()
+    set(SUPPORT_KLEE_EH_CXX 0) # For config.h
+    message(STATUS "Support for C++ Exceptions (only available for LLVM >= 8.0.0) disabled")
+  endif()
+
+else()
+  set(SUPPORT_KLEE_EH_CXX 0) # For config.h
+endif()
+
+################################################################################
 # Sanitizer support
 ################################################################################
 message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")