From 4235d88e106e083ae41bfa245beae58772446c13 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 12 May 2004 07:38:48 +0000 Subject: [PATCH] Make the 'glob' rule in the project scope to operate relatively to the 'source-location', not project location. Thanks to Johannes Brunen for the bug report. [SVN r22799] --- v2/build/project.jam | 2 +- v2/test/glob.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index 08404b269..735636a85 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -600,7 +600,7 @@ module project-rules import path ; import project ; - local location = [ project.attribute $(__name__) location ] ; + local location = [ project.attribute $(__name__) source-location ] ; local all-paths = [ path.glob $(location) : $(wildcards) ] ; return $(all-paths:D="") ; } diff --git a/v2/test/glob.py b/v2/test/glob.py index 2c34709bd..cd8f67544 100644 --- a/v2/test/glob.py +++ b/v2/test/glob.py @@ -45,5 +45,22 @@ t.rm("d2/d/bin") t.run_build_system(subdir="d2/d") t.expect_addition("d2/d/bin/$toolset/debug/l.dll") +# Test that when 'source-location' is explicitly-specified +# glob works relatively to source location +t.rm("d1") + +t.write("d1/src/a.cpp", """ +int main() { return 0; } + +""") + +t.write("d1/Jamfile", """ +project : source-location src ; +exe a : [ glob *.cpp ] ../d2/d//l ; +""") + +t.run_build_system(subdir="d1") +t.expect_addition("d1/bin/$toolset/debug/a.exe") + t.cleanup()