diff options
author | Steven Knight <knight@baldmt.com> | 2004-09-18 15:24:28 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-09-18 15:24:28 (GMT) |
commit | 2ecff9e4a918f9af6e8271ebc51099c6c5357f3f (patch) | |
tree | e8031ab585e343e66317ff005a9064f0bc48cb88 /src/engine/SCons | |
parent | dda1f7bcb8bac0d5dc29d0148f28805d5f205a8f (diff) | |
download | SCons-2ecff9e4a918f9af6e8271ebc51099c6c5357f3f.zip SCons-2ecff9e4a918f9af6e8271ebc51099c6c5357f3f.tar.gz SCons-2ecff9e4a918f9af6e8271ebc51099c6c5357f3f.tar.bz2 |
Allow LIBS to contain lists of lists.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Defaults.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/Prog.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/ProgTests.py | 17 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 6ebc6eb..381b0ae 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -232,6 +232,8 @@ def _concat(prefix, list, suffix, env, f=lambda x: x): if not list: return list + if SCons.Util.is_List(list): + list = SCons.Util.flatten(list) list = f(env.subst_path(list)) result = [] diff --git a/src/engine/SCons/Scanner/Prog.py b/src/engine/SCons/Scanner/Prog.py index 6efb44a..78b7233 100644 --- a/src/engine/SCons/Scanner/Prog.py +++ b/src/engine/SCons/Scanner/Prog.py @@ -52,7 +52,9 @@ def scan(node, env, libpath = (), fs = SCons.Node.FS.default_fs): return [] if SCons.Util.is_String(libs): libs = string.split(libs) - elif not SCons.Util.is_List(libs): + elif SCons.Util.is_List(libs): + libs = SCons.Util.flatten(libs) + else: libs = [libs] try: diff --git a/src/engine/SCons/Scanner/ProgTests.py b/src/engine/SCons/Scanner/ProgTests.py index 1100f34..f7064ff 100644 --- a/src/engine/SCons/Scanner/ProgTests.py +++ b/src/engine/SCons/Scanner/ProgTests.py @@ -190,15 +190,26 @@ class ProgScanTestCase8(unittest.TestCase): class DummyNode: pass - n = DummyNode() + + n1 = DummyNode() + env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], + LIBS=[n1], + LIBPREFIXES=['p1-', 'p2-'], + LIBSUFFIXES=['.1', '2']) + s = SCons.Scanner.Prog.ProgScan(node_class = DummyNode) + path = s.path(env) + deps = s('dummy', env, path) + assert deps == [n1], deps + + n2 = DummyNode() env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], - LIBS=[n], + LIBS=[n1, [n2]], LIBPREFIXES=['p1-', 'p2-'], LIBSUFFIXES=['.1', '2']) s = SCons.Scanner.Prog.ProgScan(node_class = DummyNode) path = s.path(env) deps = s('dummy', env, path) - assert deps == [n], deps + assert deps == [n1, n2], deps def suite(): suite = unittest.TestSuite() |