Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add option enable_debug by default 'on'.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Mar 2011 14:52:02 +0000 (14:52 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Mar 2011 14:52:02 +0000 (14:52 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9884 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/Flags.cmake
buildtools/Cmake/Option.cmake

index fc99b1e..180fcd2 100644 (file)
@@ -8,8 +8,6 @@ else(NOT __VISUALC__ AND NOT __BORLANDC__)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/Zi")
 endif(NOT __VISUALC__ AND NOT __BORLANDC__)
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${custom_flags}")
-
 if(enable_compile_warnings)
        set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
 endif(enable_compile_warnings)
@@ -18,8 +16,14 @@ if(enable_compile_optimizations)
        set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
 endif(enable_compile_optimizations)
 
+if(enable_debug)
+               set(CMAKE_C_FLAGS "-DNDEBUG ${CMAKE_C_FLAGS}")
+endif(enable_debug)
+
 set(CMAKE_C_FLAGS "${optCFLAGS}${warnCFLAGS}${CMAKE_C_FLAGS}")
 
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${custom_flags}")
+
 if(enable_coverage)
        find_program(GCOV_PATH gcov)
        if(GCOV_PATH)
index 1d52118..60e1b09 100644 (file)
@@ -37,6 +37,7 @@ option(enable_print_message "Enable print message during config." off)
 option(enable_model-checking "" off)
 option(enable_lib_static "" off)
 option(enable_jedule "Jedule output of SimDAG." off)
+option(enable_debug "Set NDEBUG flag" on)
 
 if(enable_supernovae AND enable_model-checking)
        set(enable_model-checking false CACHE TYPE INTERNAL FORCE)