Please note:The SCons wiki is now restored from the attack in March 2013. All old passwords have been invalidated. Please reset your password if you have an account. If you note missing pages, please report them to Also, new account creation is currently disabled due to an ongoing spam flood (2013/08/27).
Differences between revisions 3 and 4
Revision 3 as of 2005-03-22 04:38:22
Size: 939
Editor: cpe-66-75-232-228
Revision 4 as of 2008-03-12 02:47:02
Size: 939
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

If you want to add additional compile flags, try this:

import glob

#assumes project name is the build directory name is the executable name...

project = 'myprogram'      #holds project name
buildroot = '../debug'     #holds root of the build directory tree
cflags = ['-W1', '-GX']    #some additional compile flags

#From here on will be common to all projects

builddir = buildroot + '/' + project   #holds build directory name
targetpath = builddir + '/' + project  #holds path to executable in the build directory

env = Environment()

#if cflags is defined, don't anything, otherwise append 
#the user's compile flags to the current compile flags
try: cflags
except NameError: pass
else: env.Append(CCFLAGS=cflags)

#set up the build directory
BuildDir('#' + builddir, "#.", duplicate=0)

env.Program(targetpath, source=map(lambda x: '#' + builddir + '/' + x, glob.glob('*.cpp')))

SconstructShortMsvcWin32CompileParms (last edited 2008-03-12 02:47:02 by localhost)