From e2be9048d4be614f00b0606551af1b0522755060 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 18 Sep 2003 07:44:41 +0000 Subject: [PATCH] Expand construction variables on the values of SConscript() keyword arguments. git-svn-id: http://scons.tigris.org/svn/scons/trunk@802 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Script/SConscript.py | 7 ++++++- 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 cc9562d5..2de7d545 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 0ae3583b..91352e10 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., -- 2.26.2