diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-12-16 09:24:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-12-16 09:24:06 +0200 |
commit | 5c3744e914d72916d30c9b4cb4804227d6aae736 (patch) | |
tree | 356f4a6a14f5c33772b9094416f37aa39cbd26ba /libbuild2/module.cxx | |
parent | fb9f2206a3a9b860480d2e9967561b47c1e86351 (diff) |
Pass context to (meta-)operation hooks
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r-- | libbuild2/module.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx index 9756860..3f4f1d0 100644 --- a/libbuild2/module.cxx +++ b/libbuild2/module.cxx @@ -91,8 +91,8 @@ namespace build2 // We use the same context for building any nested modules that might be // required while building modules. // - ctx.module_context = ctx.module_context_storage->get (); - ctx.module_context->module_context = ctx.module_context; + context& mctx (*(ctx.module_context = ctx.module_context_storage->get ())); + mctx.module_context = &mctx; // Setup the context to perform update. In a sense we have a long-running // perform meta-operation batch (indefinite, in fact, since we never call @@ -104,12 +104,12 @@ namespace build2 // recipes) we will see the old state. // if (mo_perform.meta_operation_pre != nullptr) - mo_perform.meta_operation_pre ({} /* parameters */, loc); + mo_perform.meta_operation_pre (mctx, {} /* parameters */, loc); - ctx.module_context->current_meta_operation (mo_perform); + mctx.current_meta_operation (mo_perform); if (mo_perform.operation_pre != nullptr) - mo_perform.operation_pre ({} /* parameters */, update_id); + mo_perform.operation_pre (mctx, {} /* parameters */, update_id); } // Note: also used by ad hoc recipes thus not static. |