Scons help!

Anuj Goyal angoyal at
Wed Mar 24 20:29:18 CET 2004

Does anyone have a scons file that make use of multiple compilers on
win32 and linux?

I am trying to get my scons script to work on win32 (using cl.exe) and
linux (using gcc) .

it is a nightmare! I need a builder (or set of builders) that is
flexible enough for both platforms.  I tried to find projects that
make use of this on the net, but could not find any :(

opt = Options(None, ARGUMENTS)
		'The compiler you want to use',

env = Environment(options=opt)

CLDEBUGCPPFLAGS = r'/nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG"
/YX /FD /c'

env['BUILDERS']['cl'] = Builder(action = 'cl '+ CLDEBUGCPPFLAGS +'
env['BUILDERS']['gcc'] = Builder(action = 'gcc -co %TARGET %SOURCE') 

env['BUILDERS']['MyCompiler'] = env['BUILDERS'][env['COMPILER']]


and here is the output.

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D
Command line warning D4024 : unrecognized source file type '%SOURCE',
object file assumed
Command line warning D4027 : source file '%SOURCE' ignored
Command line warning D4021 : no action performed
scons: done building targets.

More information about the Python-list mailing list