diff options
Diffstat (limited to 'build2/context')
-rw-r--r-- | build2/context | 11 |
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. // |