Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
remove_compiler_flags(-DNDEBUG) | remove_compiler_flags(-DNDEBUG) | ||||
# Overrides the flags for the Debug build type | # Overrides the flags for the Debug build type | ||||
# This mimics the autotools behavior by setting the CFLAGS to '-g -O2`, which | # This mimics the autotools behavior by setting the CFLAGS to '-g -O2`, which | ||||
# are not well suited for debugging. | # are not well suited for debugging. | ||||
# FIXME: update CFLAGS with better debug oriented optimization flags | # FIXME: update CFLAGS with better debug oriented optimization flags | ||||
set(CMAKE_C_FLAGS_DEBUG "-g -O2") | set(CMAKE_C_FLAGS_DEBUG "-g -O2") | ||||
# Disable all optimizations | |||||
set(CMAKE_CXX_FLAGS_DEBUG -O0) | |||||
# Prefer -g3, defaults to -g if unavailable | # Prefer -g3, defaults to -g if unavailable | ||||
add_cxx_compiler_flag_with_fallback(CMAKE_CXX_FLAGS_DEBUG -g3 -g) | add_cxx_compiler_flag_with_fallback(CMAKE_CXX_FLAGS_DEBUG -g3 -g) | ||||
# Prefer -Og, defaults to -O0 if unavailable | |||||
add_cxx_compiler_flag_with_fallback(CMAKE_CXX_FLAGS_DEBUG -Og -O0) | |||||
# Define the debugging symbols DEBUG and DEBUG_LOCKORDER when the Debug build | # Define the debugging symbols DEBUG and DEBUG_LOCKORDER when the Debug build | ||||
# type is selected. | # type is selected. | ||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -DDEBUG_LOCKORDER") | string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -DDEBUG_LOCKORDER") | ||||
# Add -ftrapv when building in Debug | # Add -ftrapv when building in Debug | ||||
add_compiler_flags_to_var(CMAKE_CXX_FLAGS_DEBUG CXX -ftrapv) | add_compiler_flags_to_var(CMAKE_CXX_FLAGS_DEBUG CXX -ftrapv) | ||||
# Ensure that WINDRES_PREPROC is enabled when using windres. | # Ensure that WINDRES_PREPROC is enabled when using windres. | ||||
▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines |