fix mashup of CCFLAGS and CXXFLAGS for scons builds.
authorStephen Swaney <sswaney@centurytel.net>
Fri, 13 Apr 2007 06:30:34 +0000 (06:30 +0000)
committerStephen Swaney <sswaney@centurytel.net>
Fri, 13 Apr 2007 06:30:34 +0000 (06:30 +0000)
CXXFLAGS defaults to CCFLAGS which was causing duplicated or
extra compile flags being set for g++.  Fix is to use
env.Replace() rather than .Append() the first time we
set CXXFLAGS in the build environment.

tools/Blender.py

index 87181b7dc0db9eb559f34b0a93824e61b5e39fdc..8f102d00e2046c9fb1dbd80c570c51893bee2566 100644 (file)
@@ -387,12 +387,18 @@ class BlenderEnvironment(SConsEnvironment):
             lenv.Append(CPPDEFINES=defines)
             if lenv['WITH_BF_GAMEENGINE']:
                     lenv.Append(CPPDEFINES=['GAMEBLENDER=1'])
+            # debug or not
+            # CXXFLAGS defaults to CCFLAGS, therefore
+            #  we Replace() rather than Append() to CXXFLAGS the first time
             if lenv['BF_DEBUG'] or (libname in quickdebug):
-                    lenv.Append(CCFLAGS = Split(lenv['BF_DEBUG_FLAGS']), CXXFLAGS = Split(lenv['BF_DEBUG_FLAGS']))
+                    lenv.Append(CCFLAGS = Split(lenv['BF_DEBUG_FLAGS']))
+                    lenv.Replace( CXXFLAGS = Split(lenv['BF_DEBUG_FLAGS']))
             else:
-                    lenv.Append(CCFLAGS = lenv['REL_CFLAGS'], CXXFLAGS = lenv['REL_CCFLAGS'])
+                    lenv.Append(CCFLAGS = lenv['REL_CFLAGS'])
+                    lenv.Replace(CXXFLAGS = lenv['REL_CCFLAGS'])
             if lenv['BF_PROFILE']:
-                    lenv.Append(CCFLAGS = Split(lenv['BF_PROFILE_FLAGS']), CXXFLAGS = Split(lenv['BF_PROFILE_FLAGS']))
+                    lenv.Append(CCFLAGS = Split(lenv['BF_PROFILE_FLAGS']),
+                                CXXFLAGS = Split(lenv['BF_PROFILE_FLAGS']))
             if compileflags:
                 lenv.Append(CCFLAGS = compileflags)
                 lenv.Append(CXXFLAGS = compileflags)