From ca24ca936a59d5d54f6ef8c6f347f460b026be65 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Wed, 17 Dec 2014 16:21:02 +0100 Subject: [PATCH] only generate debugging symbols for the build types "Debug" and "RelWithDebInfo" --- cmake/Modules/UseDebugSymbols.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/UseDebugSymbols.cmake b/cmake/Modules/UseDebugSymbols.cmake index e3eae4b3..bbe38530 100644 --- a/cmake/Modules/UseDebugSymbols.cmake +++ b/cmake/Modules/UseDebugSymbols.cmake @@ -18,12 +18,10 @@ if (CXX_COMPAT_GCC) # default debug level, if not specified by the user set_default_option (CXX _dbg_flag "-ggdb3" "(^|\ )-g") - # add debug symbols to *all* targets, regardless. there WILL come a - # time when you need to find a bug which only manifests itself in a - # release target on a production system! + # add debug symbols to *all* targets if the build mode is either "Debug" or "RelWithDebInfo" if (_dbg_flag) message (STATUS "Generating debug symbols: ${_dbg_flag}") - add_options (ALL_LANGUAGES ALL_BUILDS "${_dbg_flag}") + add_options (ALL_LANGUAGES "Debug;RelWithDebInfo" "${_dbg_flag}") endif (_dbg_flag) # extracting the debug info is done by a separate utility in the GNU