diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-27 14:43:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-27 14:43:37 +0200 |
commit | be34c36f7b9ab7d2fd0d3a7bc2a0f5f62ff4fe67 (patch) | |
tree | dacfb8ea94a3bd1850c80bec3469b657dddbf9f0 /libbuild2/context.cxx | |
parent | bdcca31f9174b342a9e125206df4c4bd11b2dda5 (diff) |
Propagate global var overrides to module build context
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r-- | libbuild2/context.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index 1cf7c7d..f310426 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -49,6 +49,7 @@ namespace build2 target_type_map global_target_types; variable_override_cache global_override_cache; + strings global_var_overrides; data (context& c): scopes (c), targets (c), var_pool (&c /* global */) {} }; @@ -72,6 +73,7 @@ namespace build2 global_scope (create_global_scope (data_->scopes)), global_target_types (data_->global_target_types), global_override_cache (data_->global_override_cache), + global_var_overrides (data_->global_var_overrides), module_context (mc ? *mc : nullptr), module_context_storage (mc ? optional<unique_ptr<context>> (nullptr) @@ -455,6 +457,11 @@ namespace build2 else data_->var_overrides.push_back ( variable_override {var, *o, move (dir), move (r.first)}); + + // Save global overrides for nested contexts. + // + if (c == '!') + data_->global_var_overrides.push_back (s); } // Enter builtin variables and patterns. |