BUG#895: Adding -DNDEBUG to C and C++ flags for release builds.
This commit is contained in:
parent
5bbfbd56f5
commit
830e1ac1d9
|
@ -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 "")
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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 ")
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue