From d39c6460fc6e1e48a4eb8221a5c32dc84e3110d9 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 9 Oct 2002 20:12:00 +0000 Subject: [PATCH] Fix dependency scanning when overriding LIBS (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@476 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ src/engine/SCons/Node/__init__.py | 4 ++-- test/LIBS.py | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index bda89034..8d6bad5c 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -88,6 +88,8 @@ RELEASE 0.09 - function to the Environment that allows people to define their own similar variables. + - Fix dependency scans when $LIBS is overridden. + From sam th: - Dynamically check for the existence of utilities with which to diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index c67ed927..75a27c06 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -205,13 +205,13 @@ class Node: for child in self.children(scan=0): self._add_child(self.implicit, - child.get_implicit_deps(self.env, + child.get_implicit_deps(self.generate_build_env(), child.source_scanner, self)) # scan this node itself for implicit dependencies self._add_child(self.implicit, - self.get_implicit_deps(self.env, + self.get_implicit_deps(self.generate_build_env(), self.target_scanner, self)) diff --git a/test/LIBS.py b/test/LIBS.py index b9fb275a..22bf3f19 100644 --- a/test/LIBS.py +++ b/test/LIBS.py @@ -124,6 +124,31 @@ test.run(arguments = '.') test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c\n') +# +test.write('SConstruct', """ +env = Environment() +env.Program(target='foo', source='foo.c', LIBS=['bar', 'baz'], LIBPATH = '.') +SConscript('sub1/SConscript', 'env') +SConscript('sub2/SConscript', 'env') +""") + +test.run(arguments = '.') + +test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c\n') + +test.write(['sub1', 'baz.c'], r""" +#include + +void baz() +{ + printf("sub1/baz.c 2\n"); +} +""") + +test.run(arguments = '.') + +test.run(program=foo_exe, stdout='sub1/bar.c\nsub1/baz.c 2\n') + test.pass_test() -- 2.26.2