diff options
author | Steven Knight <knight@baldmt.com> | 2003-01-25 06:37:58 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-01-25 06:37:58 (GMT) |
commit | b0ef6b2dcf13bd6ad09a6b41fbeaee2279e1c6e8 (patch) | |
tree | c7d79e912ad1d74a43730b5e634a38f15a34e678 | |
parent | 8057681b1689332abd2611ef1bdf5e52485a8301 (diff) | |
download | SCons-b0ef6b2dcf13bd6ad09a6b41fbeaee2279e1c6e8.zip SCons-b0ef6b2dcf13bd6ad09a6b41fbeaee2279e1c6e8.tar.gz SCons-b0ef6b2dcf13bd6ad09a6b41fbeaee2279e1c6e8.tar.bz2 |
Fix adding a prefix when the target isn't specified.
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Builder.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/BuilderTests.py | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 391ddf8..8f3d990 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -39,6 +39,9 @@ RELEASE 0.11 - XXX the previous Builder attributes from the construction Environment. (Bug reported by Bj=F6rn Bylander.) + - Fix adding a prefix to a file when the target isn't specified. + (Bug reported by Esa Ilari Vuokko.) + From Anthony Roach: - Use a different static object suffix (.os) when using gcc so shared diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 8de58c8..ed2b767 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -289,7 +289,7 @@ class BuilderBase: s = source[0] if isinstance(s, SCons.Node.Node): s = os.path.split(str(s))[1] - target = [ os.path.splitext(s)[0] + suf ] + target = [ pre + os.path.splitext(s)[0] + suf ] else: target = adjustixes(target, pre, suf) diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 11674d6..8b9bd94 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -323,6 +323,9 @@ class BuilderTestCase(unittest.TestCase): tgt = builder(env, target = 'tgt2a tgt2b', source = 'src2') assert tgt.path == 'libtgt2a tgt2b', \ "Target has unexpected name: %s" % tgt.path + tgt = builder(env, source = 'src3') + assert tgt.path == 'libsrc3', \ + "Target has unexpected name: %s" % tgt.path def test_src_suffix(self): """Test Builder creation with a specified source file suffix @@ -377,6 +380,9 @@ class BuilderTestCase(unittest.TestCase): tgt = builder(env, target = 'tgt4a tgt4b', source = 'src4') assert tgt.path == 'tgt4a tgt4b.o', \ "Target has unexpected name: %s" % tgt.path + tgt = builder(env, source = 'src5') + assert tgt.path == 'src5.o', \ + "Target has unexpected name: %s" % tgt.path def test_ListBuilder(self): """Testing ListBuilder class.""" |