From bdae1e81eb6d319e3cfbbad8f5e3545c2c0050a2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 23 Oct 2002 10:39:23 +0000 Subject: [PATCH] Honour use-requirements for dependency properties. [SVN r15964] --- src/build/targets.jam | 2 +- test/use_requirements.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index 976422c82..876bab773 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -400,7 +400,7 @@ rule basic-target ( name : project if dependency in [ feature.attributes $(p:G) ] { local g = [ generate-source $(p:G=) : $(properties) ] ; - xproperties += $(p:G)$(g) ; + xproperties += $(p:G)$(g) [ $(g).use-requirements ] ; } else { diff --git a/test/use_requirements.py b/test/use_requirements.py index f398f6c63..b4b1193ad 100644 --- a/test/use_requirements.py +++ b/test/use_requirements.py @@ -21,6 +21,25 @@ t.run_build_system() t.run_build_system("--clean") +# Test that use requirements on main target work, when they are referred using +# 'dependency' features. +t.write("project-root.jam", "import gcc ;") +t.write("Jamfile", """ + lib b : b.cpp : : : FOO ; + exe a : a.cpp : b ; +""") +t.write("b.cpp", "void foo() {}") +t.write("a.cpp", """ +#ifdef FOO +int main() {} +#endif +""") + +t.run_build_system() + +t.run_build_system("--clean") + + # Test that use requirement on project work t.write("Jamfile", "exe a : a.cpp lib/b ;") t.write("lib/Jamfile", """