diff options
| author | Steven Knight <knight@baldmt.com> | 2003-09-18 07:44:41 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2003-09-18 07:44:41 (GMT) |
| commit | 1379d2829c9d41fb72675f0d64a291a3f5706d16 (patch) | |
| tree | 61b4a238da260fecf696b3743d932423ed313151 | |
| parent | 727266233825f379a02fc3a32c1fa46d1ffb1fe8 (diff) | |
| download | SCons-1379d2829c9d41fb72675f0d64a291a3f5706d16.zip SCons-1379d2829c9d41fb72675f0d64a291a3f5706d16.tar.gz SCons-1379d2829c9d41fb72675f0d64a291a3f5706d16.tar.bz2 | |
Expand construction variables on the values of SConscript() keyword arguments.
| -rw-r--r-- | src/engine/SCons/Script/SConscript.py | 7 | ||||
| -rw-r--r-- | test/SConscript-build_dir.py | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index cc9562d..2de7d54 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -433,7 +433,12 @@ class SConsEnvironment(SCons.Environment.Base): def SConscript(self, *ls, **kw): ls = map(lambda l, self=self: self.subst(l), ls) - return apply(_SConscript, [self.fs,] + ls, kw) + subst_kw = {} + for key, val in kw.items(): + if SCons.Util.is_String(val): + val = self.subst(val) + subst_kw[key] = val + return apply(_SConscript, [self.fs,] + ls, subst_kw) def SetOption(self, name, value): name = self.subst(name) diff --git a/test/SConscript-build_dir.py b/test/SConscript-build_dir.py index 0ae3583..91352e1 100644 --- a/test/SConscript-build_dir.py +++ b/test/SConscript-build_dir.py @@ -65,7 +65,8 @@ def cat(env, source, target): f.write(open(src, "rb").read()) f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}) +env = Environment(BUILDERS={'Cat':Builder(action=cat)}, + BUILD='build') Export("env") @@ -84,7 +85,7 @@ SConscript('src/SConscript', build_dir='build/var3', duplicate=0) SConscript('src/SConscript', build_dir=var6) SConscript('src/SConscript', build_dir=var7, src_dir=src, duplicate=0) -SConscript('src/SConscript', build_dir='../build/var8', duplicate=0) +env.SConscript('src/SConscript', build_dir='../$BUILD/var8', duplicate=0) # This tests the fact that if you specify a src_dir that is above # the dir a SConscript is in, that we do the intuitive thing, i.e., |
