[cmake] Avoid rel+asserts warnings when passing -UNDEBUG

MSVC 2012 gives warning D9025, "overriding /D NDEBUG with -UNDEBUG".
Removing the original definition of NDEBUG silences this.

llvm-svn: 178967
This commit is contained in:
Reid Kleckner 2013-04-07 01:45:01 +00:00
parent 594e073ba0
commit 026d8d196d

View File

@ -21,6 +21,9 @@ if( LLVM_ENABLE_ASSERTIONS )
# explicitly undefine it:
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
add_definitions( -UNDEBUG )
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
else()
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )