From a387efa59e695ba6b752a5830e458a843c5b3c6b Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 25 Jan 2003 06:37:58 +0000 Subject: [PATCH] Fix adding a prefix when the target isn't specified. git-svn-id: http://scons.tigris.org/svn/scons/trunk@564 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 3 +++ src/engine/SCons/Builder.py | 2 +- src/engine/SCons/BuilderTests.py | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 391ddf88..8f3d990a 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 8de58c82..ed2b767a 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 11674d64..8b9bd943 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.""" -- 2.26.2