[llvm-commits] [llvm] r72774 - in /llvm/trunk: CMakeLists.txt docs/CMake.html tools/llvm-config/CMakeLists.txt
Oscar Fuentes
ofv at wanadoo.es
Wed Jun 3 08:11:25 PDT 2009
Author: ofv
Date: Wed Jun 3 10:11:25 2009
New Revision: 72774
URL: http://llvm.org/viewvc/llvm-project?rev=72774&view=rev
Log:
CMake: Implements and documents option LLVM_ENABLE_ASSERTS.
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/docs/CMake.html
llvm/trunk/tools/llvm-config/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=72774&r1=72773&r2=72774&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Wed Jun 3 10:11:25 2009
@@ -17,6 +17,8 @@
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 @@
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()
Modified: llvm/trunk/docs/CMake.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.html?rev=72774&r1=72773&r2=72774&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.html (original)
+++ llvm/trunk/docs/CMake.html Wed Jun 3 10:11:25 2009
@@ -248,6 +248,10 @@
<dt><b>LLVM_ENABLE_THREADS</b>:BOOL</dt>
<dd>Build with threads support, if available. Defaults to ON.</dd>
+ <dt><b>LLVM_ENABLE_ASSERTS</b>:BOOL</dt>
+ <dd>Enables code asserts. Defaults to ON if and only if
+ CMAKE_BUILD_TYPE is <i>Release</i>.</dd>
+
<dt><b>LLVM_ENABLE_PIC</b>:BOOL</dt>
<dd>Add the <i>-fPIC</i> flag to the compiler command-line, if the
compiler supports this flag. Some systems, like Windows, does not
Modified: llvm/trunk/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/CMakeLists.txt?rev=72774&r1=72773&r2=72774&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-config/CMakeLists.txt Wed Jun 3 10:11:25 2009
@@ -87,7 +87,6 @@
DEPENDS ${LIBDEPS}
COMMENT "Checking for cyclic dependencies between LLVM libraries.")
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
set(C_FLGS "${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(CXX_FLGS "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(CPP_FLGS "${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
More information about the llvm-commits
mailing list