From ac5dcbf56584bd5c6a7159283914d55bb8ced41e Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Fri, 20 Jan 2012 11:37:55 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6899c34af..30e1c56a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)