From f9bf8ef5e2234eaa495bec0c37b54d6d7f5ce41c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 4 Nov 2002 17:24:41 +0000 Subject: [PATCH] Made 'include' adjustment for generated headers work when other targets are specified as sources, not only as dependency properties. * new/virtual-target.jam (subvariant-dg): Note which sources are roots of dependency grapgs and record those graphs. [SVN r16095] --- new/virtual-target.jam | 11 +++++++++++ test/dependency-test/Jamfile | 12 +++++++++++- test/dependency-test/e.cpp | 6 ++++++ test/dependency-test/y.foo | 0 test/dependency_test.py | 2 ++ v2/build/virtual-target.jam | 11 +++++++++++ v2/test/dependency-test/Jamfile | 12 +++++++++++- v2/test/dependency-test/e.cpp | 6 ++++++ v2/test/dependency-test/y.foo | 0 v2/test/dependency_test.py | 2 ++ 10 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 test/dependency-test/e.cpp create mode 100644 test/dependency-test/y.foo create mode 100644 v2/test/dependency-test/e.cpp create mode 100644 v2/test/dependency-test/y.foo diff --git a/new/virtual-target.jam b/new/virtual-target.jam index ace04bb38..d4f977638 100644 --- a/new/virtual-target.jam +++ b/new/virtual-target.jam @@ -569,6 +569,17 @@ local rule subvariant-dg ( main-target : properties * : virtual-targets * ) for local d in [ $(t).dependencies ] { self.other-dg += [ $(d).dg ] ; + } + local a = [ $(t).action ] ; + if $(a) + { + for local s in [ $(a).sources ] + { + if [ $(s).root ] + { + self.other-dg += [ $(s).dg ] ; + } + } } } self.other-dg = [ sequence.unique $(self.other-dg) ] ; diff --git a/test/dependency-test/Jamfile b/test/dependency-test/Jamfile index 1c536f08e..aea2bcdaf 100644 --- a/test/dependency-test/Jamfile +++ b/test/dependency-test/Jamfile @@ -19,5 +19,15 @@ exe c : c.cpp : FOO a ; + +# Try the same as above, only when other target is specified +# not as dependency, but as source + +lib d + : y.foo + ; -#DEPENDS tra-ra : <./gcc/debug/shared-false/threading-single>x.h ; \ No newline at end of file +exe e + : e.cpp d + : FOO + ; diff --git a/test/dependency-test/e.cpp b/test/dependency-test/e.cpp new file mode 100644 index 000000000..2935cafbb --- /dev/null +++ b/test/dependency-test/e.cpp @@ -0,0 +1,6 @@ + +#include "x.h" + +int main() +{ +} \ No newline at end of file diff --git a/test/dependency-test/y.foo b/test/dependency-test/y.foo new file mode 100644 index 000000000..e69de29bb diff --git a/test/dependency_test.py b/test/dependency_test.py index 368d2bb7d..eb0ad0fe3 100644 --- a/test/dependency_test.py +++ b/test/dependency_test.py @@ -9,6 +9,8 @@ t.run_build_system() # Check that main target 'c' was able to find 'x.h' from # 'a's dependency graph t.expect_addition("bin/gcc/debug/main-target-c/c") +# Check that main target 'e' was able to find 'y.h' +t.expect_addition("bin/gcc/debug/main-target-e/e") # Check handling of first level includes. diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index ace04bb38..d4f977638 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -569,6 +569,17 @@ local rule subvariant-dg ( main-target : properties * : virtual-targets * ) for local d in [ $(t).dependencies ] { self.other-dg += [ $(d).dg ] ; + } + local a = [ $(t).action ] ; + if $(a) + { + for local s in [ $(a).sources ] + { + if [ $(s).root ] + { + self.other-dg += [ $(s).dg ] ; + } + } } } self.other-dg = [ sequence.unique $(self.other-dg) ] ; diff --git a/v2/test/dependency-test/Jamfile b/v2/test/dependency-test/Jamfile index 1c536f08e..aea2bcdaf 100644 --- a/v2/test/dependency-test/Jamfile +++ b/v2/test/dependency-test/Jamfile @@ -19,5 +19,15 @@ exe c : c.cpp : FOO a ; + +# Try the same as above, only when other target is specified +# not as dependency, but as source + +lib d + : y.foo + ; -#DEPENDS tra-ra : <./gcc/debug/shared-false/threading-single>x.h ; \ No newline at end of file +exe e + : e.cpp d + : FOO + ; diff --git a/v2/test/dependency-test/e.cpp b/v2/test/dependency-test/e.cpp new file mode 100644 index 000000000..2935cafbb --- /dev/null +++ b/v2/test/dependency-test/e.cpp @@ -0,0 +1,6 @@ + +#include "x.h" + +int main() +{ +} \ No newline at end of file diff --git a/v2/test/dependency-test/y.foo b/v2/test/dependency-test/y.foo new file mode 100644 index 000000000..e69de29bb diff --git a/v2/test/dependency_test.py b/v2/test/dependency_test.py index 368d2bb7d..eb0ad0fe3 100644 --- a/v2/test/dependency_test.py +++ b/v2/test/dependency_test.py @@ -9,6 +9,8 @@ t.run_build_system() # Check that main target 'c' was able to find 'x.h' from # 'a's dependency graph t.expect_addition("bin/gcc/debug/main-target-c/c") +# Check that main target 'e' was able to find 'y.h' +t.expect_addition("bin/gcc/debug/main-target-e/e") # Check handling of first level includes.