From 3239bc2435ddcd9dae0a177360a3644d85008c42 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jul 2016 10:32:29 +0200 Subject: Print project name and out_root in config reports --- build2/context | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build2/context') diff --git a/build2/context b/build2/context index dc7d0c0..93cf5ad 100644 --- a/build2/context +++ b/build2/context @@ -8,13 +8,13 @@ #include #include +#include #include #include #include namespace build2 { - class scope; class file; extern dir_path work; @@ -58,6 +58,15 @@ namespace build2 variable_overrides reset (const strings& cmd_vars); + // Return the project name or empty string if unnamed. + // + inline const string& + project (scope& root) + { + auto l (root["project"]); + return l ? cast (l) : empty_string; + } + // Return the src/out directory corresponding to the given out/src. The // passed directory should be a sub-directory of out/src_root. // -- cgit v1.1