From: Matthias Maier Date: Thu, 20 Jun 2013 17:46:10 +0000 (+0000) Subject: CMake: Use -Og for debug builds with gcc if available X-Git-Tag: v8.0.0~276 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5088f76490addb05ca973d84399a0cd11a5e8a3c;p=dealii.git CMake: Use -Og for debug builds with gcc if available git-svn-id: https://svn.dealii.org/trunk@29842 0785d39b-7218-0410-832d-ea1e28bc413d --- 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")