From 2169f0e960c6e2b94518c03e6eb0406908b96e65 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jan 2020 09:07:09 +0200 Subject: Improve module loading API --- libbuild2/bin/init.cxx | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'libbuild2/bin/init.cxx') diff --git a/libbuild2/bin/init.cxx b/libbuild2/bin/init.cxx index 1e5ccc5..344d54e 100644 --- a/libbuild2/bin/init.cxx +++ b/libbuild2/bin/init.cxx @@ -161,8 +161,7 @@ namespace build2 // Load bin.vars. // - if (!cast_false (rs["bin.vars.loaded"])) - load_module (rs, rs, "bin.vars", loc); + load_module (rs, rs, "bin.vars", loc); // Configure. // @@ -423,8 +422,7 @@ namespace build2 // Load bin.config. // - if (!cast_false (rs["bin.config.loaded"])) - load_module (rs, rs, "bin.config", loc, false, hints); + load_module (rs, rs, "bin.config", loc, hints); // Cache some config values we will be needing below. // @@ -551,7 +549,7 @@ namespace build2 r.insert (perform_uninstall_id, "bin.lib", gr); } - if (const test::module* m = rs.lookup_module ("test")) + if (const test::module* m = rs.find_module ("test")) { r.insert (perform_test_id, "bin.lib", m->group_rule ()); } @@ -574,8 +572,7 @@ namespace build2 // Make sure bin.config is loaded. // - if (!cast_false (rs["bin.config.loaded"])) - load_module (rs, bs, "bin.config", loc, false, hints); + load_module (rs, bs, "bin.config", loc, hints); // Enter configuration variables. // @@ -723,11 +720,8 @@ namespace build2 // Make sure the bin core and ar.config are loaded. // - if (!cast_false (bs["bin.loaded"])) - load_module (rs, bs, "bin", loc, false, hints); - - if (!cast_false (bs["bin.ar.config.loaded"])) - load_module (rs, bs, "bin.ar.config", loc, false, hints); + load_module (rs, bs, "bin", loc, hints); + load_module (rs, bs, "bin.ar.config", loc, hints); return true; } @@ -746,8 +740,7 @@ namespace build2 // Make sure bin.config is loaded. // - if (!cast_false (rs["bin.config.loaded"])) - load_module (rs, rs, "bin.config", loc, false, hints); + load_module (rs, rs, "bin.config", loc, hints); // Enter configuration variables. // @@ -820,11 +813,8 @@ namespace build2 // Make sure the bin core and ld.config are loaded. // - if (!cast_false (bs["bin.loaded"])) - load_module (rs, bs, "bin", loc, false, hints); - - if (!cast_false (bs["bin.ld.config.loaded"])) - load_module (rs, bs, "bin.ld.config", loc, false, hints); + load_module (rs, bs, "bin", loc, hints); + load_module (rs, bs, "bin.ld.config", loc, hints); const string& lid (cast (rs["bin.ld.id"])); @@ -856,8 +846,7 @@ namespace build2 // Make sure bin.config is loaded. // - if (!cast_false (bs["bin.config.loaded"])) - load_module (rs, bs, "bin.config", loc, false, hints); + load_module (rs, bs, "bin.config", loc, hints); // Enter configuration variables. // @@ -930,11 +919,8 @@ namespace build2 // Make sure the bin core and rc.config are loaded. // - if (!cast_false (bs["bin.loaded"])) - load_module (rs, bs, "bin", loc, false, hints); - - if (!cast_false (bs["bin.rc.config.loaded"])) - load_module (rs, bs, "bin.rc.config", loc, false, hints); + load_module (rs, bs, "bin", loc, hints); + load_module (rs, bs, "bin.rc.config", loc, hints); return true; } -- cgit v1.1