aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-26 10:02:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-26 10:02:18 +0200
commit08de44303033cc5ad966f4e75a7fa4a3cb06635f (patch)
tree090b21375b91a6b7999813d17469d20d58ab6060 /libbuild2/context.cxx
parent97e00dccb4a9d3abc3c896b33560ed6aed0a1763 (diff)
Implement updating build system modules
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r--libbuild2/context.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index db46319..e35f308 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -54,7 +54,11 @@ namespace build2
};
context::
- context (scheduler& s, const strings& cmd_vars, bool dr, bool kg)
+ context (scheduler& s,
+ bool dr,
+ bool kg,
+ const strings& cmd_vars,
+ optional<unique_ptr<context>> mc)
: data_ (new data (*this)),
sched (s),
dry_run_option (dr),
@@ -67,7 +71,9 @@ namespace build2
functions (data_->functions),
global_scope (create_global_scope (data_->scopes)),
global_target_types (data_->global_target_types),
- global_override_cache (data_->global_override_cache)
+ global_override_cache (data_->global_override_cache),
+ module_context (mc ? mc->get () : nullptr),
+ module_context_storage (move (mc))
{
tracer trace ("context");
@@ -76,7 +82,7 @@ namespace build2
scope_map& sm (data_->scopes);
variable_pool& vp (data_->var_pool);
- register_builtin_functions (functions);
+ insert_builtin_functions (functions);
// Initialize the meta/operation tables. Note that the order should match
// the id constants in <libbuild2/operation.hxx>.