summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2017-12-18 08:50:12 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-18 08:17:35 -0800
commit0f3bda4c4490f9fd836090747112f3b00912ae0a (patch)
treef6604a75dbc49ac703c32a5719638f6ff4752cf6 /CMakeLists.txt
parent5e116db1a19f344a6edbb70a535273e9381f8aea (diff)
downloadsubsurface-0f3bda4c4490f9fd836090747112f3b00912ae0a.tar.gz
Compile with -O2 optimization even in debug mode
The -O0 default is useless owing to extremely convoluted assembly. Moreover, many warnings depending on data analysis are ineffective with -O0. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8d9b9e87..650b0d43b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,6 +100,10 @@ endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+# optimize -O2 even for debug builds
+set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
+
# pkgconfig for required libraries
find_package(PkgConfig)
include(cmake/Modules/pkgconfig_helper.cmake)