Skip to content

Commit

Permalink
[cmake] Avoid rel+asserts warnings when passing -UNDEBUG
Browse files Browse the repository at this point in the history
MSVC 2012 gives warning D9025, "overriding /D NDEBUG with -UNDEBUG".
Removing the original definition of NDEBUG silences this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178967 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Apr 7, 2013
1 parent 53d4bcf commit 16f1969
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down

0 comments on commit 16f1969

Please sign in to comment.