Commit 830e1ac1 authored by Brad King's avatar Brad King
Browse files

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

parent 5bbfbd56
......@@ -44,8 +44,8 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,+h")
SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
SET (CMAKE_C_FLAGS_INIT "")
......
......@@ -8,8 +8,8 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
SET (CMAKE_C_FLAGS_INIT "")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
......
......@@ -37,8 +37,8 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
......
......@@ -34,12 +34,12 @@ ELSE (CMAKE_COMPILER_IS_GNUCXX)
# use default OSF compiler flags
SET (CMAKE_C_FLAGS_INIT "")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
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_DEBUG_INIT "-Od -v")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O1")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Od")
SET (CMAKE_C_FLAGS_INIT "-w- -whid -waus -tWM")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-Od -v")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Od")
SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ")
......
IF(CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_C_FLAGS_INIT "")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_CXX_FLAGS_INIT "")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment