Expand construction variables on the values of SConscript() keyword arguments.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 18 Sep 2003 07:44:41 +0000 (07:44 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 18 Sep 2003 07:44:41 +0000 (07:44 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@802 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/SConscript.py
test/SConscript-build_dir.py

index cc9562d5925bb215dbcb5f157141c86eadb2a224..2de7d545d63364d2c522f49d3f04d03bf1bd0654 100644 (file)
@@ -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)
index 0ae3583b299f8ee3e03a8dceff07052e97712432..91352e1060aefe856b554d3d74eafec4193a63c0 100644 (file)
@@ -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.,