Fixed optimization flags for release builds.

cmake uses CMAKE_C_FLAGS_RELEASE in addition to CMAKE_C_FLAGS for
make based build systems. Without the fix the optimization level
argument is set twice (-O2 -O3) and -O3 was used instead of -O2.
This commit is contained in:
Bernhard Miklautz 2012-01-20 11:37:55 +01:00
parent 94d44c2aba
commit ac5dcbf565

View File

@ -65,6 +65,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()
if(WITH_SSE2_TARGET)