WAF: don't change CXXFLAGS if CXXFLAGS is set in the OS environment (so that user CXXFLAGS take precedence).
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 10 Jul 2007 13:42:23 +0100
changeset 924 fa23f33acca0
parent 923 f5d38217e7a2
child 925 914adb9a1aab
WAF: don't change CXXFLAGS if CXXFLAGS is set in the OS environment (so that user CXXFLAGS take precedence).
wscript
--- a/wscript	Tue Jul 10 13:37:17 2007 +0100
+++ b/wscript	Tue Jul 10 13:42:23 2007 +0100
@@ -106,7 +106,8 @@
 
     variant_env.append_value('CXXDEFINES', 'RUN_SELF_TESTS')
     
-    if os.path.basename(conf.env['CXX']).startswith("g++"):
+    if (os.path.basename(conf.env['CXX']).startswith("g++")
+        and 'CXXFLAGS' not in os.environ):
         variant_env.append_value('CXXFLAGS', ['-Wall', '-Werror'])
 
     if 'debug' in Params.g_options.debug_level.lower():
@@ -115,7 +116,8 @@
 
     ## 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():
+    if ('optimized' in Params.g_options.debug_level.lower() 
+        and 'CXXFLAGS' not in os.environ):
         for flag in variant_env['CXXFLAGS_DEBUG']:
             ## this probably doesn't work for MSVC
             if flag.startswith('-g'):