aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-08-16 10:30:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-08-16 10:30:35 +0200
commitd91e48ea57b83f7018a25d3f54bba96cf889d66d (patch)
treeaa6376de69751ae0488febc8fb4faed041699687 /libbuild2/module.cxx
parent50bf3956c88ee6341d0023a421d502d604e3da4f (diff)
Add ability to initialize bootstrapped modules after loading root.build
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r--libbuild2/module.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx
index bb877d9..02ea64d 100644
--- a/libbuild2/module.cxx
+++ b/libbuild2/module.cxx
@@ -581,7 +581,7 @@ namespace build2
// The only valid situation here is if the module has already been
// bootstrapped.
//
- assert (i->boot);
+ assert (i->boot_init);
return;
}
@@ -594,22 +594,22 @@ namespace build2
fail (loc) << "build system module " << mod << " should not be loaded "
<< "during bootstrap";
- lm.push_back (module_state {true, false, mod, mf.init, nullptr, loc});
+ lm.push_back (module_state {loc, mod, mf.init, nullptr, nullopt});
i = lm.end () - 1;
{
- module_boot_extra e;
+ module_boot_extra e {nullptr, module_boot_init::before};
// Note: boot() can load additional modules invalidating the iterator.
//
size_t j (i - lm.begin ());
- bool f (mf.boot (rs, loc, e));
+ mf.boot (rs, loc, e);
i = lm.begin () + j;
- i->first = f;
-
if (e.module != nullptr)
i->module = move (e.module);
+
+ i->boot_init = e.init;
}
rs.assign (rs.var_pool ().insert (mod + ".booted")) = true;
@@ -640,7 +640,7 @@ namespace build2
fail (loc) << "build system module " << mod << " should be loaded "
<< "during bootstrap";
- lm.push_back (module_state {false, false, mod, mf->init, nullptr, loc});
+ lm.push_back (module_state {loc, mod, mf->init, nullptr, nullopt});
i = lm.end () - 1;
}
}
@@ -648,9 +648,9 @@ namespace build2
{
module_state& s (*i);
- if (s.boot)
+ if (s.boot_init)
{
- s.boot = false;
+ s.boot_init = nullopt;
f = true; // This is a first call to init.
}
}