From 91734f1772aeca9795040d2db03b4f29051fa922 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Aug 2019 15:38:28 +0200 Subject: Cleanup context.hxx and its usage --- libbuild2/scope.hxx | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'libbuild2/scope.hxx') diff --git a/libbuild2/scope.hxx b/libbuild2/scope.hxx index f69e822..0c4094b 100644 --- a/libbuild2/scope.hxx +++ b/libbuild2/scope.hxx @@ -12,12 +12,13 @@ #include #include +#include #include +#include +#include #include #include #include -#include -#include #include @@ -370,6 +371,28 @@ namespace build2 return os << s.out_path ().representation (); // Always absolute. } + // Return the src/out directory corresponding to the given out/src. The + // passed directory should be a sub-directory of out/src_root. + // + dir_path + src_out (const dir_path& out, const scope& root); + + dir_path + src_out (const dir_path& out, + const dir_path& out_root, const dir_path& src_root); + + dir_path + out_src (const dir_path& src, const scope& root); + + dir_path + out_src (const dir_path& src, + const dir_path& out_root, const dir_path& src_root); + + // Return the project name or empty string if unnamed. + // + const project_name& + project (const scope& root); + // Temporary scope. The idea is to be able to create a temporary scope in // order not to change the variables in the current scope. Such a scope is // not entered in to the scope map. As a result it can only be used as a -- cgit v1.1