From 5088f76490addb05ca973d84399a0cd11a5e8a3c Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 20 Jun 2013 17:46:10 +0000 Subject: [PATCH] CMake: Use -Og for debug builds with gcc if available git-svn-id: https://svn.dealii.org/trunk@29842 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/setup_compiler_flags_gnu.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deal.II/cmake/setup_compiler_flags_gnu.cmake b/deal.II/cmake/setup_compiler_flags_gnu.cmake index 0b35afc511..fdc33164cd 100644 --- a/deal.II/cmake/setup_compiler_flags_gnu.cmake +++ b/deal.II/cmake/setup_compiler_flags_gnu.cmake @@ -126,7 +126,13 @@ IF (CMAKE_BUILD_TYPE MATCHES "Debug") LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") - ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0") + ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Og") + # + # If -Og is not available, fall back to -O0: + # + IF(NOT DEAL_II_HAVE_FLAG_O0) + ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0") + ENDIF() ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ggdb") ENABLE_IF_SUPPORTED(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-ggdb") -- 2.39.5