]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Use -Og for debug builds with gcc if available
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 20 Jun 2013 17:46:10 +0000 (17:46 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 20 Jun 2013 17:46:10 +0000 (17:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@29842 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/setup_compiler_flags_gnu.cmake

index 0b35afc511fdb4fc28af9c075e182a5dc1a301fc..fdc33164cdd17ad2b52977f23e5a3fbbe42934ef 100644 (file)
@@ -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")

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.