From fb4f4ec1c4af2a66ab2fdc0e20f2aa2f6ff347ba Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 28 Apr 2003 08:46:16 +0000 Subject: [PATCH] Fix path properties handling bug, noted by Kirill Lapshin. * new/property.jam (translate-paths): Apply 'path.make' to path properties. * test/path_features.py: Test for the bug. [SVN r18325] --- new/property.jam | 4 +++- test/path_features.py | 25 +++++++++++++++++++++++++ v2/build/property.jam | 4 +++- v2/test/path_features.py | 25 +++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/new/property.jam b/new/property.jam index 7c60320f1..b9b1cb60f 100644 --- a/new/property.jam +++ b/new/property.jam @@ -356,6 +356,8 @@ rule split-conditional ( property ) # Interpret all path properties in 'properties' as relative to 'path' +# The property values are assumed to be in system-specific form, and +# will be translated into normalized form. rule translate-paths ( properties * : path ) { local result ; @@ -371,7 +373,7 @@ rule translate-paths ( properties * : path ) if path in [ feature.attributes $(p:G) ] { - local t = [ path.root $(p:TG=) $(path) ] ; + local t = [ path.root [ path.make $(p:TG=) ] $(path) ] ; result += $(condition)$(t:TG=$(p:G)) ; } else diff --git a/test/path_features.py b/test/path_features.py index b53d66572..ba89e2bf5 100644 --- a/test/path_features.py +++ b/test/path_features.py @@ -38,5 +38,30 @@ int main() { foo(); } t.rm("d/bin") t.run_build_system(subdir="d") +# Test that absolute paths inside requirements are ok. The problem +# appear only when building targets in subprojects. +t.write("project-root.jam", "") +t.write("Jamfile", "build-project x ; ") +t.write("x/Jamfile", """ +local pwd = [ PWD ] ; +project : requirements $(pwd)/x/include ; +exe m : m.cpp : $(pwd)/x/include2 ; +""") +t.write("x/m.cpp", """ +#include +#include + +int main() {} +""") +t.write("x/include/h1.hpp", "\n") +t.write("x/include2/h2.hpp", "\n") + +t.run_build_system() +t.expect_addition("x/bin/$toolset/debug/main-target-m/m.exe") + + + + + t.cleanup() diff --git a/v2/build/property.jam b/v2/build/property.jam index 7c60320f1..b9b1cb60f 100644 --- a/v2/build/property.jam +++ b/v2/build/property.jam @@ -356,6 +356,8 @@ rule split-conditional ( property ) # Interpret all path properties in 'properties' as relative to 'path' +# The property values are assumed to be in system-specific form, and +# will be translated into normalized form. rule translate-paths ( properties * : path ) { local result ; @@ -371,7 +373,7 @@ rule translate-paths ( properties * : path ) if path in [ feature.attributes $(p:G) ] { - local t = [ path.root $(p:TG=) $(path) ] ; + local t = [ path.root [ path.make $(p:TG=) ] $(path) ] ; result += $(condition)$(t:TG=$(p:G)) ; } else diff --git a/v2/test/path_features.py b/v2/test/path_features.py index b53d66572..ba89e2bf5 100644 --- a/v2/test/path_features.py +++ b/v2/test/path_features.py @@ -38,5 +38,30 @@ int main() { foo(); } t.rm("d/bin") t.run_build_system(subdir="d") +# Test that absolute paths inside requirements are ok. The problem +# appear only when building targets in subprojects. +t.write("project-root.jam", "") +t.write("Jamfile", "build-project x ; ") +t.write("x/Jamfile", """ +local pwd = [ PWD ] ; +project : requirements $(pwd)/x/include ; +exe m : m.cpp : $(pwd)/x/include2 ; +""") +t.write("x/m.cpp", """ +#include +#include + +int main() {} +""") +t.write("x/include/h1.hpp", "\n") +t.write("x/include2/h2.hpp", "\n") + +t.run_build_system() +t.expect_addition("x/bin/$toolset/debug/main-target-m/m.exe") + + + + + t.cleanup()