aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-27 13:29:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-27 13:29:49 +0200
commitbdcca31f9174b342a9e125206df4c4bd11b2dda5 (patch)
treefb6d5720f4bb77bf38ba33d48b9d6aa9b286ee95 /libbuild2/context.cxx
parent7debe1e029cc1b09676ce3a8401ab21e45e82b7e (diff)
Redo module context pointer
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r--libbuild2/context.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index 87685ef..1cf7c7d 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -58,7 +58,7 @@ namespace build2
bool dr,
bool kg,
const strings& cmd_vars,
- optional<unique_ptr<context>> mc)
+ optional<context*> mc)
: data_ (new data (*this)),
sched (s),
dry_run_option (dr),
@@ -72,8 +72,10 @@ namespace build2
global_scope (create_global_scope (data_->scopes)),
global_target_types (data_->global_target_types),
global_override_cache (data_->global_override_cache),
- module_context (mc ? mc->get () : nullptr),
- module_context_storage (move (mc))
+ module_context (mc ? *mc : nullptr),
+ module_context_storage (mc
+ ? optional<unique_ptr<context>> (nullptr)
+ : nullopt)
{
tracer trace ("context");