diff options
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/SCons/Builder.py | 3 | ||||
| -rw-r--r-- | src/engine/SCons/BuilderTests.py | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 9edd121..fe6283b 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -286,7 +286,8 @@ class BuilderBase: source = adjustixes(source, None, src_suf) if target is None: - target = map(lambda x, s=suf: os.path.splitext(x)[0] + s, + target = map(lambda x, s=suf: + os.path.splitext(os.path.split(str(x))[1])[0] + s, source) else: target = adjustixes(target, pre, suf) diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 8451d99..e862b05 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -833,6 +833,19 @@ class BuilderTestCase(unittest.TestCase): assert str(tgt[1].sources[0]) == 'h0.c', map(str, tgt[1].sources) assert str(tgt[1].sources[1]) == 'h1.c', map(str, tgt[1].sources) + w = b(env, target='i0.w', source=['i0.x']) + y = b(env, target='i1.y', source=['i1.z']) + tgt = b(env, source=[w, y]) + assert len(tgt) == 2, map(str, tgt) + assert str(tgt[0]) == 'i0.o' + assert str(tgt[1]) == 'i1.o' + assert len(tgt[0].sources) == 2, map(str, tgt[0].sources) + assert str(tgt[0].sources[0]) == 'i0.w', map(str, tgt[0].sources) + assert str(tgt[0].sources[1]) == 'i1.y', map(str, tgt[0].sources) + assert len(tgt[1].sources) == 2, map(str, tgt[1].sources) + assert str(tgt[1].sources[0]) == 'i0.w', map(str, tgt[1].sources) + assert str(tgt[1].sources[1]) == 'i1.y', map(str, tgt[1].sources) + if __name__ == "__main__": suite = unittest.makeSuite(BuilderTestCase, 'test_') |
