[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/config darwin-config.py linux2-config.py linuxcross-config.py openbsd3-config.py sunos5-config.py win32-mingw-config.py

Ken Hughes khughes at pacific.edu
Fri Apr 13 07:44:50 CEST 2007

Joshua Leung wrote:
> Hi,
> Here with mingw/gcc, gcc is complaining about these flag(s) when 
> compiling C++ code (i.e. Ghost)
> "cc1plus.exe: warning: command line option 
> "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++"

I think I tracked down why this is happening, but maybe Nathan can tell 
me if I've got a fix:

It seems that for some reason, in tools/Blender.py the lenv['CXXFLAGS'] 
variable is being set to contain $CCFLAGS.  If around line 386, right 
after lenv is created I put
then g++ isn't invoked with -Wdeclaration-after-statement (it also takes 
away some of the other flags, but some playing around will add back all 
the other useful g++ flags).

Here's the full diff I'm using now and on linux it seems happy and quiet:

#-----cut here-----------
--- tools/Blender.py    5 Apr 2007 05:14:50 -0000       1.31
+++ tools/Blender.py    13 Apr 2007 05:40:34 -0000
@@ -383,6 +383,7 @@ class BlenderEnvironment(SConsEnvironmen
                  print bc.HEADER+'Configuring library 
'+bc.ENDC+bc.OKGREEN+libname + bc.ENDC
              lenv = self.Copy()
+            lenv['CXXFLAGS']=''
              if lenv['WITH_BF_GAMEENGINE']:
@@ -396,8 +397,9 @@ class BlenderEnvironment(SConsEnvironmen
              if compileflags:
                  lenv.Append(CCFLAGS = compileflags)
                  lenv.Append(CXXFLAGS = compileflags)
-            lenv.Append(CCFLAGS = Split(lenv['C_WARN']))
              lenv.Append(CXXFLAGS = Split(lenv['CC_WARN']))
+            lenv.Append(CXXFLAGS = Split(lenv['CCFLAGS']))
+            lenv.Append(CCFLAGS = Split(lenv['C_WARN']))
              lib = lenv.Library(target= 
'#'+root_build_dir+'lib/'+libname, source=sources)
              SConsEnvironment.Default(self, lib) # we add to default 
target, because this way we get some kind of progress info during build
#-----cut here-----------


More information about the Bf-committers mailing list