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:
@@ -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) ;
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user