aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
commitc4fcbad1cb603756dc4dac65392feb86be1a722d (patch)
treeda9c9c2278c63d20237a7178fde450d7472a59c9 /libbuild2/module.cxx
parentccb417a7c1456427b76914e8a11ca87b4926eeb3 (diff)
Rename module_base to module, redo module boot/init argument passing
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r--libbuild2/module.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx
index cc79af0..191853a 100644
--- a/libbuild2/module.cxx
+++ b/libbuild2/module.cxx
@@ -521,7 +521,11 @@ namespace build2
i = lm.emplace (mod,
module_state {true, false, mf.init, nullptr, loc}).first;
- i->second.first = mf.boot (rs, loc, i->second.module);
+
+ {
+ module_boot_extra extra {i->second.module};
+ i->second.first = mf.boot (rs, loc, extra);
+ }
rs.assign (rs.var_pool ().insert (mod + ".booted")) = true;
}
@@ -608,7 +612,12 @@ namespace build2
else
{
l = i != lm.end ();
- c = l && i->second.init (rs, bs, loc, i->second.module, f, opt, hints);
+
+ if ((c = l))
+ {
+ module_init_extra extra {i->second.module, hints};
+ c = i->second.init (rs, bs, loc, f, opt, extra);
+ }
lv = l;
cv = c;
@@ -641,7 +650,7 @@ namespace build2
init_module (rs, bs, name, loc, opt, hints);
}
- unique_ptr<module_base>&
+ const shared_ptr<module>&
load_module (scope& rs,
scope& bs,
const string& name,