Suppose I have a SConstruct
which exports a construction environment to a subsidiary SConscript
:
Export('SConscript', 'env')
I'd like for SConscript
to insert a command line variable foo
into env
so that I can invoke builds with the command
scons foo=bar
Is this possible, or must support for such command line variables be supplied to the environment's constructor?
Create a new Variables
object containing the new variable and then update the environmentin the subsidiary
SConscript`:
Import('env')
vars = Variables()
vars.Add('foo', help='a command line variable named foo')
vars.Update(env)