scons: add OS_ENV option, to forward all of OS environment to scons

This commit is contained in:
Chris Beck 2014-11-01 23:13:23 -04:00
parent 9f93831a23
commit 8f93e0ebb0

View file

@ -105,6 +105,7 @@ opts.AddVariables(
BoolVariable('openmp', 'Enable openmp use.', False),
BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False),
BoolVariable("lockfile", "Create a lockfile to prevent multiple instances of scons from being run at the same time on this working copy.", False),
BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False),
BoolVariable("sdl2", "Build with SDL2 support (experimental!)", False)
)
@ -131,6 +132,10 @@ if env["lockfile"]:
opts.Save(GetOption("option_cache"), env)
env.SConsignFile("$build_dir/sconsign.dblite")
# If OS_ENV was enabled, copy the entire OS environment.
if env['OS_ENV']:
env['ENV'] = os.environ
# Make sure the user's environment is always available
env['ENV']['PATH'] = os.environ.get("PATH")
env['ENV']['TERM'] = os.environ.get("TERM")