It is also possible to merge construction variable values from arguments
given to the
Environment call itself.
parse_flags keyword argument
is given, its value is distributed to construction variables in the
new environment in the same way as
described for the
This also works when calling
as well as in overrides to builder methods
(see Section 7.2.14, “Overriding Construction Variable Settings”).
env = Environment(parse_flags="-I/opt/include -L/opt/lib -lfoo") for k in ('CPPPATH', 'LIBPATH', 'LIBS'): print("%s:" % k, env.get(k)) env.Program("f1.c")
scons -QCPPPATH: ['/opt/include'] LIBPATH: ['/opt/lib'] LIBS: ['foo'] cc -o f1.o -c -I/opt/include f1.c cc -o f1 f1.o -L/opt/lib -lfoo