aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-04-07 01:45:01 +0000
committerReid Kleckner <reid@kleckner.net>2013-04-07 01:45:01 +0000
commit16f19693282b41bb6b0a627e417684add6f26de4 (patch)
tree2c44330ccf704bd7ae6c4f84101a8087a6fba46c /cmake
parent53d4bcf35e7bc362e9340085264c2f4acd3c912b (diff)
downloadexternal_llvm-16f19693282b41bb6b0a627e417684add6f26de4.zip
external_llvm-16f19693282b41bb6b0a627e417684add6f26de4.tar.gz
external_llvm-16f19693282b41bb6b0a627e417684add6f26de4.tar.bz2
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 4e59a3e..516f2dd 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -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" )