From 9c445a83bc03ca4a0335e98704feee44183831a6 Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Fri, 4 Sep 2020 22:04:57 +0200 Subject: Exception handling only for LLVM >= 8.0.0 --- CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 916c2d74..1fa4fcc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -704,6 +704,28 @@ else() set(SUPPORT_KLEE_LIBCXX 0) # For config.h 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 ################################################################################ -- cgit 1.4.1