2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Make the 'explicit' rule always operate on the current project.

[SVN r32654]
This commit is contained in:
Vladimir Prus
2006-02-06 15:26:56 +00:00
parent cd2cd5b6f0
commit a2ade745b1
2 changed files with 40 additions and 1 deletions

View File

@@ -876,7 +876,11 @@ module project-rules
rule explicit ( target-names * )
{
import project ;
local t = [ project.target $(__name__) ] ;
# If 'explicit' is used in a helper rule defined in Jamroot,
# and inherited by children, then most of the time
# we want 'explicit' to operate on the Jamfile where
# the helper rule is invoked.
local t = [ project.current ] ;
for local n in $(target-names)
{
$(t).mark-target-as-explicit $(n) ;

View File

@@ -36,5 +36,40 @@ t.expect_nothing_more()
t.run_build_system("hello2")
t.expect_addition("bin/$toolset/debug/hello2.exe")
t.rm(".")
# Test that 'explicit' used in a helper rule applies to the current project,
# and not to the Jamfile where the helper rule is defined.
t.write("Jamroot", """
rule myinstall ( name : target )
{
install $(name)-bin : $(target) ;
explicit $(name)-bin ;
alias $(name) : $(name)-bin ;
}
""")
t.write("sub/a.cpp", """
""")
t.write("sub/Jamfile", """
myinstall dist : a.cpp ;
""")
t.run_build_system(subdir="sub")
t.expect_addition("sub/dist-bin/a.cpp")
t.rm("sub/dist-bin")
t.write("sub/Jamfile", """
myinstall dist : a.cpp ;
explicit dist ;
""")
t.run_build_system(subdir="sub")
t.expect_nothing_more()
t.cleanup()