diff options
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dc14583..01a42fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -62,8 +62,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |||
62 | STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") | 62 | STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") |
63 | endif() | 63 | endif() |
64 | 64 | ||
65 | # Enable asserts regardless of build type | 65 | # Do not disable assertions based on CMAKE_BUILD_TYPE |
66 | add_definitions(-UNDEBUG) | 66 | foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo") |
67 | foreach(_lang C CXX) | ||
68 | string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var) | ||
69 | string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " ${_var} "${${_var}}") | ||
70 | endforeach() | ||
71 | endforeach() | ||
67 | 72 | ||
68 | set(BUILD_NC true) | 73 | set(BUILD_NC true) |
69 | 74 | ||