diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -470,13 +470,6 @@ set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE) endif() -string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) -if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") - set(LIBCXX_DEBUG_BUILD ON) -else() - set(LIBCXX_DEBUG_BUILD OFF) -endif() - #=============================================================================== # Setup Compiler Flags #=============================================================================== @@ -585,13 +578,6 @@ endif() endif() -# Assertion flags ============================================================= -define_if(LIBCXX_DEBUG_BUILD -D_DEBUG) -if (LIBCXX_ENABLE_ASSERTIONS AND NOT LIBCXX_DEBUG_BUILD) - # MSVC doesn't like _DEBUG on release builds. See PR 4379. - define_if_not(MSVC -D_DEBUG) -endif() - # Modules flags =============================================================== # FIXME The libc++ sources are fundamentally non-modular. They need special # versions of the headers in order to provide C++03 and legacy ABI definitions. @@ -604,6 +590,8 @@ endif() endfunction() +string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) + # Sanitizer flags ============================================================= function(get_sanitizer_flags OUT_VAR USE_SANITIZER) @@ -711,7 +699,7 @@ endif() if (MSVC) - if (LIBCXX_DEBUG_BUILD) + if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") set(LIB_SUFFIX "d") else() set(LIB_SUFFIX "")