Skip to content

Commit

Permalink
Merge pull request #320 from cbeck88/backport_scons_changes
Browse files Browse the repository at this point in the history
backport scons changes
  • Loading branch information
cbeck88 committed Nov 2, 2014
2 parents 33f6343 + 5ebf88d commit ebdb03a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SConstruct
Expand Up @@ -103,7 +103,8 @@ opts.AddVariables(
BoolVariable('cxx0x', 'Use C++0x features.', False),
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("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)
)

#
Expand All @@ -124,9 +125,16 @@ 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")
term = os.environ.get('TERM')
if term is not None:
env['ENV']['TERM'] = term

if env["PLATFORM"] == "win32":
env.Tool("mingw")
elif env["PLATFORM"] == "sunos":
Expand Down

0 comments on commit ebdb03a

Please sign in to comment.