Skip to content
Snippets Groups Projects
Commit b0fb0592 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm release types other than RELEASE and DEBUG; debug with -g3; rm DebugOptimization.cmake

parent 51730cdd
No related branches found
No related tags found
1 merge request!2130for debug, compile with -g3; cleanup CMake code
......@@ -204,13 +204,7 @@ endif()
if(ALGORITHM_DIAGNOSTIC)
string(APPEND CMAKE_CXX_FLAGS " -DALGORITHM_DIAGNOSTIC=ON")
endif()
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DBA_DEBUG")
# debug optimization
if(BA_DEBUG_OPTIMIZATION)
include(commons/DebugOptimization)
endif()
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DBA_DEBUG") # changes behavior of ASSERT
### Configure source components
......
......@@ -11,7 +11,12 @@ else()
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_DEBUG "-g3")
if(GCC)
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -Og")
else()
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -O2")
endif()
string(APPEND CMAKE_CXX_FLAGS " -I${CMAKE_SOURCE_DIR}/Wrap -pipe ${BIT_ENVIRONMENT} -Wall -W -Woverloaded-virtual -Wno-unknown-pragmas -fPIC")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
......
......@@ -51,11 +51,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " -flat_namespace -single_module -undefined dynamic_lookup")
# Select flags.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-inline")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline")
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O2 -fno-reorder-blocks -fno-inline")
#settings for cint
set(CPPPREP "${CMAKE_CXX_COMPILER} -E -C")
......@@ -72,11 +69,8 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang OR ${CMAKE_CXX_COMPILER_ID} STREQ
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " -flat_namespace -single_module -undefined dynamic_lookup")
# Select flags.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-inline")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline")
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
#settings for cint
set(CPPPREP "${CMAKE_CXX_COMPILER} -E -C")
......
# DebugOptimization.cmake
#
# description: add debug optimization (gcc only)
#
# usage: from build directory
#
# cmake .. -DCMAKE_BUILD_TYPE=Debug
# ctest (or make check)
# cmake --build . --config Debug --target coverage
#
# author: Jonathan Fisher
# j.fisher@fz-juelich.de, jonathan.m.fisher@gmail.com
#
# copyright: 2016 scientific computing group, Forshungszentrum Juelich GmbH
#
# license: see LICENSE
#
if(GCC)
string(APPEND CMAKE_CXX_FLAGS " -Og")
else()
message(WARNING "C compiler is not GNU; debug optimization has no effect")
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment