[Bf-committers] Fixing some SCons issues...

Mathias Wein lynx at yafray.org
Sun Sep 23 16:54:59 CEST 2007


Hi,

there's several things i'd like to see changed in the scons scripts.

First, i still think the change in tools/Blender.py at revision 10517
broke the C++ compiler flags completely. It's simply missing all flags
now except the extra warning and release or debug flags. This makes building
with MSVC 7.1 fail at linking due to mixing of runtimes (/MT and /EHsc
missing for C++ sources) but all platforms may be missing important flags
for C++ files (-funsigned-char on linux/unix)
What i think was intended is to replace CXXFLAGS, which default
to $CCFLAGS (i.e. a variable) with a _copy_ of CCFLAGS so further
changes to CCFLAGS (now C-Compiler only) and CXXFLAGS (C++ compiler)
don't affect each other.
I propose this fix which I use for linux and windows/msvc8:
http://lynx.aspect-design.de/blender/blender_scons.patch


Also, the flags in config/win32-vc-config.py are for 7.1
I'd at least add a commented version for msvc 8 (MS removed several
flags and spits warning like mad), i use:
CCFLAGS = ['/nologo', '/Ot', '/Ob1', '/EHsc', '/J', '/Gd', '/MT']
It would even be possible to let scons choose depending on
"env['MSVS']['VERSION']" but that needs a couple more changes...

Finally, two SConscripts still have hardcoded compiler flags, those are
extern/solid/SConscript and extern/bullet2/src/SConscript.
 From what i see, the "compilerflags" argument of BlenderLib()
is just appended, so most of the flags are redundant anyway.
Again spits warning about uknown flags with MSVC8.

A rather cosmetic change:
instead of adding "-D..." or "/D..." options to CPPFLAGS, these should 
be added
to CPPDEFINES (first needs to be added to tools/btools.py too though, to
be configurable), that makes scons pick the proper the prefix ("-D" or 
"/D" etc.) automatically.
e.g. move '-DWIN32' from CPPFLAGS to 'WIN32' in CPPDEFINES.


Any opinions?
I really think the first fix is overdue...the others are just unclean but
don't seem to break anything.

Mathias
(Lynx(3D))


More information about the Bf-committers mailing list