summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-07 06:08:53 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-07 06:08:53 (GMT)
commitcbb5c537f33929ddf7795d627ccae0f42b5b361f (patch)
treee044335901f538f41beb05fae0ca16c15623748a /src
parent7fbd5909a526fc1ad282c7e701b0f7832af2e3ed (diff)
downloadSCons-cbb5c537f33929ddf7795d627ccae0f42b5b361f.zip
SCons-cbb5c537f33929ddf7795d627ccae0f42b5b361f.tar.gz
SCons-cbb5c537f33929ddf7795d627ccae0f42b5b361f.tar.bz2
Fix specifying only the source argument to a MultiStepBuilder (such as Program).
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Builder.py6
-rw-r--r--src/engine/SCons/BuilderTests.py6
3 files changed, 14 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 0c608da..c297718 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -34,6 +34,9 @@ RELEASE 0.10 - XXX
- Significant performance improvement from using a more efficient
check, throughout the code, for whether a Node has a Builder.
+ - Fix specifying only the source file to MultiStepBuilders such as
+ the Program Builder. (Bug reported by Dean Bair.)
+
From Steve Leblanc:
- Add a Clean() method to support removing user-specified targets
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index 15358c1..2c45855 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -425,7 +425,11 @@ class MultiStepBuilder(BuilderBase):
self.sdict = {}
self.cached_src_suffixes = {} # source suffixes keyed on id(env)
- def __call__(self, env, target = None, source = None, **kw):
+ def __call__(self, env, target = None, source = _null, **kw):
+ if source is _null:
+ source = target
+ target = None
+
slist = SCons.Node.arg2nodes(source, self.source_factory)
final_sources = []
diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py
index 9905eb9..57069df 100644
--- a/src/engine/SCons/BuilderTests.py
+++ b/src/engine/SCons/BuilderTests.py
@@ -420,6 +420,12 @@ class BuilderTestCase(unittest.TestCase):
assert str(tgt.sources[1]) == 'test2.foo', str(tgt.sources[1])
assert str(tgt.sources[2]) == 'test3.txt', str(tgt.sources[2])
+ tgt = builder2(env, 'aaa.bar')
+ assert str(tgt) == 'aaa', str(tgt)
+ assert str(tgt.sources[0]) == 'aaa.foo', str(tgt.sources[0])
+ assert str(tgt.sources[0].sources[0]) == 'aaa.bar', \
+ str(tgt.sources[0].sources[0])
+
builder3 = SCons.Builder.MultiStepBuilder(name = "builder3",
action = 'foo',
src_builder = 'xyzzy',