diff --git a/src/build/property-set.jam b/src/build/property-set.jam index bed3b4b4f..0dd7d958c 100644 --- a/src/build/property-set.jam +++ b/src/build/property-set.jam @@ -425,9 +425,15 @@ rule refine-from-user-input ( parent-requirements : specification * if $(remove-requirements) { + # Need to create property set, so that path features + # and indirect features are translated just like they + # are in project requirements. + local ps = [ property-set.create-from-user-input + $(remove-requirements) : $(project-module) $(location) ] ; + parent-requirements = [ property-set.create [ set.difference [ $(parent-requirements).raw ] - : $(remove-requirements) ] ] ; + : [ $(ps).raw ] ] ] ; specification = $(add-requirements) ; } diff --git a/test/remove_requirement.py b/test/remove_requirement.py index 5f49baeb0..6bbc20938 100644 --- a/test/remove_requirement.py +++ b/test/remove_requirement.py @@ -78,5 +78,38 @@ t.expect_addition("sub2/bin/$toolset/debug/link-static/hello.exe") t.expect_addition("sub3/bin/$toolset/debug/threading-multi/hello.exe") t.expect_addition("sub4/bin/$toolset/debug/threading-multi/hello.exe") +t.rm(".") + +# No test that path requirements can be removed as well. +t.write("Jamroot", """ +build-project sub ; + +""") + +t.write("sub/Jamfile", """ +project : requirements broken ; + +exe hello : hello.cpp : -broken ; +""") + +t.write("sub/hello.cpp", """ +#include "math.h" + +int main() +{ + return 0; +} + +""") + +t.write("sub/broken/math.h", """ +Broken +""") + + +t.run_build_system() + +t.expect_addition("bin/$toolset/debug/hello.exe") + t.cleanup()