summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2013-07-17 09:34:51 +0000
committerDuncan Sands <baldrick@free.fr>2013-07-17 09:34:51 +0000
commit80f122fefb62a9520ac58d94135215a4d4ca909f (patch)
treefb2d3e9e1b5a8b4ad1931302ea6f04b8e16e361e /llvm/cmake/modules
parent9ced602cc67e33e7e6136325f1503037ace2b1a6 (diff)
downloadbcm5719-llvm-80f122fefb62a9520ac58d94135215a4d4ca909f.tar.gz
bcm5719-llvm-80f122fefb62a9520ac58d94135215a4d4ca909f.zip
Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS.
The issue is that CMAKE_BUILD_TYPE=RelWithDebInfo LLVM_ENABLE_ASSERTIONS=ON was not building with assertions enabled. (I was unable to find what in the LLVM source tree was adding -DNDEBUG to the build line in this case, so decided that it must be cmake itself that was adding it - this may depend on the cmake version). The fix treats any mode that is not Debug as being the same as Release for this purpose (previously it was being assumed that cmake would only add -DNDEBUG for Release and not for RelWithDebInfo or MinSizeRel). If other versions of cmake don't add -DNDEBUG for RelWithDebInfo then that's OK: with this change you just get a useless but harmless -UNDEBUG or -DNDEBUG. llvm-svn: 186499
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 2939fa2afa2..bc6dd0ccd8f 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -17,9 +17,9 @@ if( LLVM_ENABLE_ASSERTIONS )
if( NOT MSVC )
add_definitions( -D_DEBUG )
endif()
- # On Release builds cmake automatically defines NDEBUG, so we
+ # On non-Debug 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" )
add_definitions( -UNDEBUG )
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
OpenPOWER on IntegriCloud