aboutsummaryrefslogtreecommitdiff
path: root/build2/context
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-20 10:32:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-20 10:32:29 +0200
commit3239bc2435ddcd9dae0a177360a3644d85008c42 (patch)
treec93f99b5e992d043b183f2fbaf29127bb5a562d2 /build2/context
parent5fb77d1609bb62db11ed640d089a08f34e943998 (diff)
Print project name and out_root in config reports
Diffstat (limited to 'build2/context')
-rw-r--r--build2/context11
1 files changed, 10 insertions, 1 deletions
diff --git a/build2/context b/build2/context
index dc7d0c0..93cf5ad 100644
--- a/build2/context
+++ b/build2/context
@@ -8,13 +8,13 @@
#include <build2/types>
#include <build2/utility>
+#include <build2/scope>
#include <build2/variable>
#include <build2/operation>
#include <build2/b-options>
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<string> (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.
//