[SCons] Keep SCons initial PATH when propagating PATH

Fixes errors on Windows when Visual Studio is not on the PATH but has been
found by SCons instead.
This commit is contained in:
Ray Speth 2017-02-12 17:39:13 -05:00
parent eae9250f2e
commit 66998a5ae1

View file

@ -693,9 +693,12 @@ if env['env_vars'] == 'all':
elif env['env_vars']:
for name in env['env_vars'].split(','):
if name in os.environ:
env['ENV'][name] = os.environ[name]
if name == 'PATH':
env.AppendENVPath('PATH', os.environ['PATH'])
else:
env['ENV'][name] = os.environ[name]
if env['VERBOSE']:
print 'Propagating environment variable {0}={1}'.format(name, os.environ[name])
print 'Propagating environment variable {0}={1}'.format(name, env['ENV'][name])
elif name not in defaults.env_vars.split(','):
print 'WARNING: failed to propagate environment variable', repr(name)
print ' Edit cantera.conf or the build command line to fix this.'