aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2015-01-05 20:35:25 +0100
committerJörg Mayer <jmayer@loplof.de>2015-01-05 19:37:17 +0000
commit15a238a28d0dbfffe908a6451e411a64a34da678 (patch)
treee747e83af4b5d5c652404e11900cb517f4f53a01 /CMakeLists.txt
parent13dbf52ce382d9c5d1fc9de3c3830896c8c545ef (diff)
Override optimization and other flags for make based generators.
Before this patch it was not possible to override e.g. the optimization or debug flags in case the build type was set. Change-Id: I53bfddd27f87ad5482227f786af8c4728c5774fc Reviewed-on: https://code.wireshark.org/review/6327 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 125d3008fa..4c3952382a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,13 @@ if( NOT CMAKE_BUILD_TYPE )
FORCE)
endif()
message(STATUS "Configuration types: ${CMAKE_CONFIGURATION_TYPES}")
+
+# Override optimization and other flags for make based generators
+foreach (_BT DEBUG RELEASE RELWITHDEBINFO SIZEREL)
+ set( CMAKE_C_FLAGS_${_BT} "${CMAKE_C_FLAGS_${_BT}} ${CMAKE_C_FLAGS}" )
+ set( CMAKE_CXX_FLAGS_${_BT} "${CMAKE_C_FLAGS_${_BT}} ${CMAKE_C_FLAGS}" )
+endforeach()
+
message(STATUS "${CMAKE_BUILD_TYPE}: ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
#Where to put executables and libraries in the build tree
if(NOT ARCHIVE_OUTPUT_PATH)