Send to Kindle
home » snippets » scons


Invoking builds


Passing variables from cmdline to the script

Specify them on the command line like this:

scons debug=1 .

These variables are available in SConscript files through the ARGUMENTS dictionary, and can be used in the SConscript file(s) to modify the build in any way:

if ARGUMENTS.get('debug', 0):
    env = Environment(CCFLAGS = '-g')
    env = Environment()

Command line options

In general, scons supports the same command-line options as GNU make, and many of those supported by cons.