aboutsummaryrefslogtreecommitdiff
path: root/build2/context
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-30 09:51:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-30 10:00:35 +0200
commitf89d2c16c1dad9b8d2f3b0e402a47e30521f5a69 (patch)
tree10fe158dd8ca79c89ede9d21bdbfc57104c65d57 /build2/context
parent83d5e6063f670134303a3396219f63eaac0aedff (diff)
Add support for config.build file versioning
Diffstat (limited to 'build2/context')
-rw-r--r--build2/context25
1 files changed, 24 insertions, 1 deletions
diff --git a/build2/context b/build2/context
index e7b8c7d..257e96b 100644
--- a/build2/context
+++ b/build2/context
@@ -26,12 +26,35 @@ namespace build2
// Current action (meta/operation).
//
+ // The names unlike info are available during boot but may not yet be
+ // lifted. The name is always for an outer operation (or meta operation
+ // that hasn't been recognized as such yet).
+ //
+ extern const string* current_mname;
+ extern const string* current_oname;
+
extern const meta_operation_info* current_mif;
extern const operation_info* current_inner_oif;
extern const operation_info* current_outer_oif;
-
extern execution_mode current_mode;
+ inline void
+ set_current_mif (const meta_operation_info& mif)
+ {
+ current_mif = &mif;
+ current_mname = &mif.name;
+ }
+
+ inline void
+ set_current_oif (const operation_info& inner_oif,
+ const operation_info* outer_oif = nullptr)
+ {
+ current_inner_oif = &inner_oif;
+ current_outer_oif = outer_oif;
+ current_oname = &(outer_oif == nullptr ? inner_oif : *outer_oif).name;
+ current_mode = inner_oif.mode;
+ }
+
// Total number of dependency relationships in the current action.
// Together with the target::dependents count it is incremented
// during the rule search & match phase and is decremented during