fixed: make WITH_NDEBUG cmake option work again

cmake now adds -DNDEBUG to default CXX flags
invert logic and use -UNDEBUG to remove instead
This commit is contained in:
Arne Morten Kvarving
2021-08-04 15:20:48 +02:00
parent d36e5a86a2
commit 1d4a3cc655

View File

@@ -64,8 +64,8 @@ if (CXX_COMPAT_GCC)
# use these options for release builds - full optimization
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} ${_opt_flags})
option(WITH_NDEBUG "Disable asserts in release mode" ON)
if(WITH_NDEBUG)
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -DNDEBUG)
if(NOT WITH_NDEBUG)
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -UNDEBUG)
endif()
else ()