diff --git a/v2/build/property-set.jam b/v2/build/property-set.jam index e4016230c..0cabe011b 100644 --- a/v2/build/property-set.jam +++ b/v2/build/property-set.jam @@ -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 ] ; 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) ; diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index bd2589730..d4fd49d20 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -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) ] ; diff --git a/v2/test/stage.py b/v2/test/stage.py index 69e442a34..8f14fd00d 100644 --- a/v2/test/stage.py +++ b/v2/test/stage.py @@ -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 . works +t.rm(".") +t.write("Jamroot", """ +stage a1 : d/a1.txt : . ; +""") +t.write("d/a1.txt", "") +t.run_build_system() +t.expect_addition("a1.txt") + t.cleanup()