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>
This commit is contained in:
Berthold Stoeger 2017-12-18 08:50:12 +01:00 committed by Dirk Hohndel
parent 5e116db1a1
commit 0f3bda4c44

View file

@ -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)