From accbdae9b6e985d663d8af57375c7861ecd755a1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Nov 2018 11:45:02 +0200 Subject: Add support for relative to base scope command line variable overrides Currently, if we say: $ b dir/ ./foo=bar The scope the foo=bar is set on is relative to CWD, not dir/. While this may seem wrong at first, this is the least surprising behavior when we take into account that there can be multiple dir/'s. Sometimes, however, we do want the override directory to be treated relative to (every) target's base scope that we are building. To support this we are extending the '.' and '..' special directory names (which are still resolved relative to CWD) with '...', which means "relative to the base scope of every target in the buildspec". For example: $ b dir/ .../foo=bar Is equivalent to: $ b dir/ dir/foo=bar And: $ b liba/ libb/ .../tests/foo=bar Is equivalent to: $ b liba/ libb/ liba/tests/foo=bar libb/tests/foo=bar --- build2/scope.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build2/scope.hxx') diff --git a/build2/scope.hxx b/build2/scope.hxx index 7929bce..a0c96f0 100644 --- a/build2/scope.hxx +++ b/build2/scope.hxx @@ -352,7 +352,7 @@ namespace build2 // global scope with empty key. // iterator - insert (const dir_path&, bool root); + insert (const dir_path&, bool root = false); // Find the most qualified scope that encompasses this path. // @@ -396,6 +396,7 @@ namespace build2 // Entities that can access bypassing the lock proof. // + friend int main (int, char*[]); friend variable_overrides reset (const strings&); scope& -- cgit v1.1