WAF: add debugging symbols to optimized builds
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 10 Jul 2007 13:37:17 +0100
changeset 923 f5d38217e7a2
parent 922 98bb15628b57
child 924 fa23f33acca0
WAF: add debugging symbols to optimized builds
wscript
--- a/wscript	Mon Jul 09 06:43:11 2007 -0700
+++ b/wscript	Tue Jul 10 13:37:17 2007 +0100
@@ -113,6 +113,14 @@
         variant_env.append_value('CXXDEFINES', 'NS3_DEBUG_ENABLE')
         variant_env.append_value('CXXDEFINES', 'NS3_ASSERT_ENABLE')
 
+    ## In optimized builds we still want debugging symbols, e.g. for
+    ## profiling, and at least partially usable stack traces.
+    if 'optimized' in Params.g_options.debug_level.lower():
+        for flag in variant_env['CXXFLAGS_DEBUG']:
+            ## this probably doesn't work for MSVC
+            if flag.startswith('-g'):
+                variant_env.append_value('CXXFLAGS', flag)
+
     if sys.platform == 'win32':
         if os.path.basename(conf.env['CXX']).startswith("g++"):
             variant_env.append_value("LINKFLAGS", "-Wl,--enable-runtime-pseudo-reloc")