BUG#895: Adding -DNDEBUG to C and C++ flags for release builds.

This commit is contained in:
Brad King 2004-06-01 14:08:04 -04:00
parent 5bbfbd56f5
commit 830e1ac1d9
6 changed files with 18 additions and 18 deletions

View File

@ -44,8 +44,8 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,+h") SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,+h")
SET (CMAKE_CXX_FLAGS_INIT "") SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
SET (CMAKE_C_FLAGS_INIT "") SET (CMAKE_C_FLAGS_INIT "")

View File

@ -8,8 +8,8 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>") "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
SET (CMAKE_CXX_FLAGS_INIT "") SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
SET (CMAKE_C_FLAGS_INIT "") SET (CMAKE_C_FLAGS_INIT "")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)

View File

@ -37,8 +37,8 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>") "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)

View File

@ -34,12 +34,12 @@ ELSE (CMAKE_COMPILER_IS_GNUCXX)
# use default OSF compiler flags # use default OSF compiler flags
SET (CMAKE_C_FLAGS_INIT "") SET (CMAKE_C_FLAGS_INIT "")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
SET (CMAKE_CXX_FLAGS_INIT "") SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
ENDIF(CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -74,13 +74,13 @@ SET(CMAKE_CREATE_CONSOLE_EXE "-tWC" )
SET (CMAKE_CXX_FLAGS_INIT "-w- -whid -waus -wpar -tWM") SET (CMAKE_CXX_FLAGS_INIT "-w- -whid -waus -wpar -tWM")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-Od -v") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-Od -v")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O1") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Od") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Od")
SET (CMAKE_C_FLAGS_INIT "-w- -whid -waus -tWM") SET (CMAKE_C_FLAGS_INIT "-w- -whid -waus -tWM")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-Od -v") SET (CMAKE_C_FLAGS_DEBUG_INIT "-Od -v")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Od") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Od")
SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ") SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ")

View File

@ -1,16 +1,16 @@
IF(CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_C_FLAGS_INIT "") SET (CMAKE_C_FLAGS_INIT "")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3") SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_CXX_FLAGS_INIT "") SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
ENDIF(CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_COMPILER_IS_GNUCXX)