scons: add OS_ENV option, to forward all of OS environment to scons
This commit is contained in:
parent
9f93831a23
commit
8f93e0ebb0
1 changed files with 5 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue