diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-06-03 15:11:25 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-06-03 15:11:25 +0000 |
commit | 81a875585c23ddc914e2f2955d87d1bf84696aa1 (patch) | |
tree | b9ee44738fe7f1777c7c8fab0bce69c381238f8b /CMakeLists.txt | |
parent | 5641f8d67f16b44a03290b6884ac18a08623a291 (diff) | |
download | llvm-81a875585c23ddc914e2f2955d87d1bf84696aa1.tar.gz llvm-81a875585c23ddc914e2f2955d87d1bf84696aa1.tar.bz2 llvm-81a875585c23ddc914e2f2955d87d1bf84696aa1.tar.xz |
CMake: Implements and documents option LLVM_ENABLE_ASSERTS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6af569b25a..ba63484d8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,8 @@ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.") endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) + include(FindPerl) set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) @@ -55,6 +57,16 @@ 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) +else() + option(LLVM_ENABLE_ASSERTS "Enable asserts" ON) +endif() + +if( LLVM_ENABLE_ASSERTS ) + add_definitions( -D_DEBUG -UNDEBUG ) +endif() + if( LLVM_TARGETS_TO_BUILD STREQUAL "all" ) set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) endif() |