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.