diff --git a/new/project-root.jam b/new/project-root.jam index cd1dc283c..0fa2393c8 100644 --- a/new/project-root.jam +++ b/new/project-root.jam @@ -153,6 +153,8 @@ rule project-root-object ( { case path : value = [ path.root [ path.native $(value) ] $(self.location) ] ; + # Now make the value absolute path + value = [ path.root $(value) [ path.pwd ] ] ; } if ! $(name) in $(self.constants) { diff --git a/test/stage.py b/test/stage.py index 4089daa9c..3b65cc4d1 100644 --- a/test/stage.py +++ b/test/stage.py @@ -31,4 +31,25 @@ t.expect_addition("ds/a.dll") t.run_build_system("release") t.expect_addition("rs/a.dll") +# Test the property in subprojects. +# Thanks to Kirill Lapshin for bug report. + +t.write("project-root.jam", """ +path-constant DIST : dist ; +""") +t.write("Jamfile", "build-project d ;") +t.write("d/Jamfile",""" +exe a : a.cpp ; +stage dist : a : $(DIST) ; +""") +t.write("d/a.cpp", "int main() { return 0;}\n") + +t.run_build_system() +t.expect_addition("dist/a.exe") + +t.rm("dist") +t.run_build_system(subdir="d") +t.expect_addition("dist/a.exe") + + t.cleanup() diff --git a/v2/project-root.jam b/v2/project-root.jam index cd1dc283c..0fa2393c8 100644 --- a/v2/project-root.jam +++ b/v2/project-root.jam @@ -153,6 +153,8 @@ rule project-root-object ( { case path : value = [ path.root [ path.native $(value) ] $(self.location) ] ; + # Now make the value absolute path + value = [ path.root $(value) [ path.pwd ] ] ; } if ! $(name) in $(self.constants) { diff --git a/v2/test/stage.py b/v2/test/stage.py index 4089daa9c..3b65cc4d1 100644 --- a/v2/test/stage.py +++ b/v2/test/stage.py @@ -31,4 +31,25 @@ t.expect_addition("ds/a.dll") t.run_build_system("release") t.expect_addition("rs/a.dll") +# Test the property in subprojects. +# Thanks to Kirill Lapshin for bug report. + +t.write("project-root.jam", """ +path-constant DIST : dist ; +""") +t.write("Jamfile", "build-project d ;") +t.write("d/Jamfile",""" +exe a : a.cpp ; +stage dist : a : $(DIST) ; +""") +t.write("d/a.cpp", "int main() { return 0;}\n") + +t.run_build_system() +t.expect_addition("dist/a.exe") + +t.rm("dist") +t.run_build_system(subdir="d") +t.expect_addition("dist/a.exe") + + t.cleanup()