diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -342,11 +342,11 @@ endif() # On Release builds cmake automatically defines NDEBUG, so we # explicitly undefine it: - if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE") + if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") list(APPEND LIBCXXABI_COMPILE_FLAGS -UNDEBUG) endif() else() - if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE") + if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") list(APPEND LIBCXXABI_COMPILE_FLAGS -DNDEBUG) endif() endif()