Index: SConstruct |
=================================================================== |
--- SConstruct (revision 1668) |
+++ SConstruct (working copy) |
@@ -508,6 +508,7 @@ |
result.Add('mode', 'compilation mode (debug, release)', 'release') |
result.Add('sample', 'build sample (shell, process)', '') |
result.Add('env', 'override environment settings (NAME1:value1,NAME2:value2)', '') |
+ result.Add('importenv', 'import environment settings (NAME1,NAME2)', '') |
Kevin Millikin (Chromium)
2009/04/02 12:54:11
Might be clearer to have the message string:
'imp
|
for (name, option) in SIMPLE_OPTIONS.iteritems(): |
help = '%s (%s)' % (name, ", ".join(option['values'])) |
result.Add(name, help, option.get('default')) |
@@ -626,9 +627,13 @@ |
options['arch'] = options['simulator'] |
-def ParseEnvOverrides(arg): |
+def ParseEnvOverrides(arg, imports): |
# The environment overrides are in the format NAME1:value1,NAME2:value2 |
+ # The environment imports are in the format NAME1,NAME2 |
Kevin Millikin (Chromium)
2009/04/02 12:54:11
Analogously here.
|
overrides = {} |
+ for var in imports.split(','): |
+ if var in os.environ: |
+ overrides[var] = os.environ[var] |
for override in arg.split(','): |
pos = override.find(':') |
if pos == -1: |
@@ -726,7 +731,7 @@ |
env = Environment(options=opts) |
Help(opts.GenerateHelpText(env)) |
VerifyOptions(env) |
- env_overrides = ParseEnvOverrides(env['env']) |
+ env_overrides = ParseEnvOverrides(env['env'], env['importenv']) |
SourceSignatures(env['sourcesignatures']) |