aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cxx/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-27 09:07:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-27 09:07:09 +0200
commit2169f0e960c6e2b94518c03e6eb0406908b96e65 (patch)
tree73cfda5d0c7aa38c74104cca89931045db37892e /libbuild2/cxx/init.cxx
parent1abc10223b37d9ead3454a06e176b4b65370a2be (diff)
Improve module loading API
Diffstat (limited to 'libbuild2/cxx/init.cxx')
-rw-r--r--libbuild2/cxx/init.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx
index 8f404ea..d2601c4 100644
--- a/libbuild2/cxx/init.cxx
+++ b/libbuild2/cxx/init.cxx
@@ -369,8 +369,7 @@ namespace build2
// Load cc.core.vars so that we can cache all the cc.* variables.
//
- if (!cast_false<bool> (rs["cc.core.vars.loaded"]))
- load_module (rs, rs, "cc.core.vars", loc);
+ load_module (rs, rs, "cc.core.vars", loc);
// Enter all the variables and initialize the module data.
//
@@ -532,10 +531,8 @@ namespace build2
// Load cxx.guess.
//
- if (!cast_false<bool> (rs["cxx.guess.loaded"]))
- load_module (rs, rs, "cxx.guess", loc, false, hints);
+ auto& cm (load_module<config_module> (rs, rs, "cxx.guess", loc, hints));
- config_module& cm (*rs.lookup_module<config_module> ("cxx.guess"));
cm.init (rs, loc, hints);
return true;
}
@@ -580,10 +577,11 @@ namespace build2
// Load cxx.config.
//
- if (!cast_false<bool> (rs["cxx.config.loaded"]))
- load_module (rs, rs, "cxx.config", loc, false, hints);
+ // @@ TODO: move guess to config and use return value?
+ //
+ load_module (rs, rs, "cxx.config", loc, hints);
- config_module& cm (*rs.lookup_module<config_module> ("cxx.guess"));
+ config_module& cm (*rs.find_module<config_module> ("cxx.guess"));
auto& vp (rs.ctx.var_pool.rw (rs));