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

Fix a recent regression: <location>. did not work.

[SVN r26598]
This commit is contained in:
Vladimir Prus
2004-12-29 11:04:09 +00:00
parent 55afc7ce31
commit 2365aa5e3e
3 changed files with 23 additions and 7 deletions

View File

@@ -231,6 +231,12 @@ class property-set
return $(self.as-path) ;
}
# Computes the target path that should be used for
# target with these properties.
# Returns a list of
# - the computed path
# - if the path is relative to build directory, a value of
# 'true'.
rule target-path ( )
{
if ! $(self.target-path)
@@ -253,12 +259,14 @@ class property-set
local prefix = [ get <location-prefix> ] ;
if $(prefix)
{
self.target-path = "." [ path.join $(prefix) $(p) ] ;
self.target-path = [ path.join $(prefix) $(p) ] ;
}
else
{
self.target-path = "." $(p) ;
self.target-path = $(p) ;
}
# The path is relative to build dir.
self.target-path += true ;
}
}
return $(self.target-path) ;

View File

@@ -500,15 +500,14 @@ class file-target : abstract-file-target
local p = [ $(self.action).properties ] ;
local path = [ $(p).target-path ] ;
if $(path[1]) = "."
if $(path[2]) = true
{
# Indicates that the path is relative to
# build dir.
path = [ path.root $(path[2])
[ $(self.project).build-dir ] ] ;
path = [ path.join [ $(self.project).build-dir ]
$(path[1]) ] ;
}
# Store the computed path, so that it's not recomputed
# any more
self.path = [ path.native $(path) ] ;

View File

@@ -166,6 +166,15 @@ t.write("a2.txt", "")
t.run_build_system("a2")
t.expect_addition(["dist/a1.txt", "dist/a2.txt"])
# Regression test: check if <location>. works
t.rm(".")
t.write("Jamroot", """
stage a1 : d/a1.txt : <location>. ;
""")
t.write("d/a1.txt", "")
t.run_build_system()
t.expect_addition("a1.txt")
t.cleanup()