about summary refs log tree commit diff homepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@comsys.rwth-aachen.de>2023-03-29 18:50:43 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2023-03-30 09:43:06 +0100
commit66e1044824d07697e6745a516451d75a21808938 (patch)
tree419052bc8674aaacdaf87932b6cfe668a5bb6cb3 /CMakeLists.txt
parent13cfabb17dfb5305cbc8ddc2a2ab94b527f3f30e (diff)
downloadklee-66e1044824d07697e6745a516451d75a21808938.tar.gz
fix CMake: -UNDEBUG
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 024d8a50..e6daa815 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,8 +90,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
 option(ENABLE_KLEE_ASSERTS "Enable KLEE assertions" ON)
 if (ENABLE_KLEE_ASSERTS)
   message(STATUS "KLEE assertions enabled")
-  # We have to add the undefine to the flags, otherwise "-D-UDNDEBUG" will be added
-  list(APPEND KLEE_COMPONENT_CXX_FLAGS "-UDNDEBUG")
+  # We have to undefine `NDEBUG` (which CMake adds by default) using `FLAGS`
+  # and not `DEFINES` since `target_compile_definitions` does not support `-U`.
+  list(APPEND KLEE_COMPONENT_CXX_FLAGS "-UNDEBUG")
 else()
   message(STATUS "KLEE assertions disabled")
   list(APPEND KLEE_COMPONENT_CXX_DEFINES "-DNDEBUG")