about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@comsys.rwth-aachen.de>2020-12-17 14:38:43 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2020-12-18 12:37:47 +0000
commita9184832f238d1753667173a113bae7a5cfbe159 (patch)
tree6b5ef5689d37888c03c146b852c671f83c3eb98d
parent1a2e56fbf683a480459261c198fe6fa8085f2523 (diff)
downloadklee-a9184832f238d1753667173a113bae7a5cfbe159.tar.gz
fix cflags for runtime build types
- `-DNDebug` -> `-DNDEBUG`
- different flags for `Release{+Debug,}+Asserts`
- `-g` is no longer part of common flags
- `-D_DEBUG` is now only set for debug builds
- removed unused `LIB_BC_FLAGS_{32,64}`
- added example, architecture prefix for specific flags
-rw-r--r--runtime/CMakeLists.txt25
1 files changed, 11 insertions, 14 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 54521f8b..6ee6f830 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -34,17 +34,17 @@ foreach (bc_architecture ${bc_architectures})
 
         # Set specific compiler flags depending on the optimization
         if (bc_optimization STREQUAL "Release")
-            list(APPEND local_flags -O2 -DNDebug)
+            list(APPEND local_flags -O2 -DNDEBUG)
         elseif (bc_optimization STREQUAL "Release+Debug")
-            list(APPEND local_flags -O2 -g -DNDebug)
+            list(APPEND local_flags -O2 -g -D_DEBUG -DNDEBUG)
         elseif (bc_optimization STREQUAL "Release+Asserts")
-            list(APPEND local_flags -O2 -g)
+            list(APPEND local_flags -O2)
         elseif (bc_optimization STREQUAL "Release+Debug+Asserts")
-            list(APPEND local_flags -O2 -g)
+            list(APPEND local_flags -O2 -g -D_DEBUG)
         elseif (bc_optimization STREQUAL "Debug")
-            list(APPEND local_flags -g -DNDebug)
+            list(APPEND local_flags -g -D_DEBUG -DNDEBUG)
         elseif (bc_optimization STREQUAL "Debug+Asserts")
-            list(APPEND local_flags -g)
+            list(APPEND local_flags -g -D_DEBUG)
         else()
             message(FATAL_ERROR
                     "Optimization (\"${bc_optimization}\") for runtime library unknown.")
@@ -59,13 +59,12 @@ message(STATUS "LIB_BC_SUFFIX: ${LIB_BC_SUFFIX}")
 message(STATUS "KLEE_RUNTIME_DIRECTORY: ${KLEE_RUNTIME_DIRECTORY}")
 
 # Add additional setups if needed, e.g.
-# `list(APPEND LIB_BC_SUFFIX MY_SPECIAL_CONFIG)`
+# `list(APPEND LIB_BC_SUFFIX 64_MY_SPECIAL_CONFIG)`
 
-# Following define the specific flags: LIB_BC_FLAGS_*SUFFIX_FROM_ABOVE*
-set(LIB_BC_FLAGS_64)
-set(LIB_BC_FLAGS_32
-        -m32
-        )
+# Following define the specific flags: LIB_BC_FLAGS_*SUFFIX_FROM_ABOVE*, e.g.
+# ```set(LIB_BC_FLAGS_64_MY_SPECIAL_CONFIG
+#         -DSOME_DEFINE
+# )``
 
 # Common for all library configurations
 # Since the runtime now contains fortified libc functions, it is
@@ -74,8 +73,6 @@ set(LIB_BC_FLAGS_32
 set(COMMON_CC_FLAGS
         "-I${CMAKE_SOURCE_DIR}/include"
         "-I${CMAKE_BINARY_DIR}/include"
-        -g
-        -D_DEBUG
         -D_FORTIFY_SOURCE=0
         -D_GNU_SOURCE
         -D__STDC_LIMIT_MACROS