For anything than the Debug build, the toolchain now set the _DNDEBUG and NDEBUG symbols.
They were not set by default before, which mean that all "assert" were still active even in Release builds!
This commit is contained in:
@@ -16,6 +16,9 @@ string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
|
||||
|
||||
if (UPPER_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
||||
add_definitions (-D_DEBUG)
|
||||
else ()
|
||||
add_definitions (-DNDEBUG)
|
||||
add_definitions (-D_DNDEBUG)
|
||||
endif ()
|
||||
|
||||
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
|
||||
|
Reference in New Issue
Block a user