aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-06-04 09:26:16 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-06-04 09:26:16 +0000
commit91d635d5da4dbb314e71c12c52cc730e5cf2bd77 (patch)
tree6fcb4b69d145724c7f40b5458f64bb48b1df097d /CMakeLists.txt
parentb6eb34a07edec5b6d25a6b71386ba461ac9b785a (diff)
downloadexternal_llvm-91d635d5da4dbb314e71c12c52cc730e5cf2bd77.zip
external_llvm-91d635d5da4dbb314e71c12c52cc730e5cf2bd77.tar.gz
external_llvm-91d635d5da4dbb314e71c12c52cc730e5cf2bd77.tar.bz2
CMake: Renamed LLVM_ENABLE_ASSERTS to
LLVM_ENABLE_ASSERTIONS. Fine-tuned the logic that controls the definition of NDEBUG and _DEBUG macros. Thanks to Jay Foad for this suggestions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba63484..a846eae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,13 +58,22 @@ endif( MSVC )
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
- option(LLVM_ENABLE_ASSERTS "Enable asserts" OFF)
+ option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
else()
- option(LLVM_ENABLE_ASSERTS "Enable asserts" ON)
+ option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
-if( LLVM_ENABLE_ASSERTS )
- add_definitions( -D_DEBUG -UNDEBUG )
+if( LLVM_ENABLE_ASSERTIONS )
+ add_definitions( -D_DEBUG )
+ # On Release builds cmake automatically defines NDEBUG, so we
+ # explicitly undefine it:
+ if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
+ add_definitions( -UNDEBUG )
+ endif()
+else()
+ if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
+ add_definitions( -DNDEBUG )
+ endif()
endif()
if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )