From d348f6a0206c5ef1573a6ea7a4a9ee8e2ecd2401 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Sep 2004 14:25:04 +0000 Subject: [PATCH] Support the && syntax in the property.translate-paths rule. [SVN r25339] --- v2/build/property.jam | 9 ++++++++- v2/test/path_features.py | 19 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/v2/build/property.jam b/v2/build/property.jam index 83989d4f4..643a8b135 100644 --- a/v2/build/property.jam +++ b/v2/build/property.jam @@ -11,6 +11,7 @@ import regex ; import sequence ; import set ; import path ; +import assert ; # Refines 'properties' by overriding any non-free properties # for which a different value is specified in 'requirements'. @@ -410,7 +411,13 @@ rule translate-paths ( properties * : path ) if path in [ feature.attributes $(p:G) ] { - local t = [ path.root [ path.make $(p:TG=) ] $(path) ] ; + local values = [ regex.split $(p:TG=) "&&" ] ; + local t ; + for local v in $(values) + { + t += [ path.root [ path.make $(v) ] $(path) ] ; + } + t = $(t:J="&&") ; result += $(condition)$(t:TG=$(p:G)) ; } else diff --git a/v2/test/path_features.py b/v2/test/path_features.py index 4510f93d2..7640e4a04 100644 --- a/v2/test/path_features.py +++ b/v2/test/path_features.py @@ -59,9 +59,20 @@ t.write("x/include2/h2.hpp", "\n") t.run_build_system() t.expect_addition("x/bin/$toolset/debug/m.exe") - - - - +# Test that "&&" in path features is handled correctly. +t.rm("bin") +t.write("Jamfile", "build-project sub ;") +t.write("sub/Jamfile", """ +exe a : a.cpp : ../h1&&../h2 ; +""") +t.write("sub/a.cpp", """ +#include +int main() { return OK; } +""") +t.write("h2/header.h", """ +const int OK = 0; +""") +t.run_build_system() +t.expect_addition("sub/bin/$toolset/debug/a.exe") t.cleanup()