From 2069cbb8f72bceb0fcb968ba05968a24eeb0c15d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Mar 2017 15:32:42 +0200 Subject: Unconditionally load bin.ar module in c and cxx modules With our utility library/until test approach this will probably be more common than not. --- build2/cc/init.cxx | 23 +++++------------------ build2/cc/module.cxx | 22 ++++++++-------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/build2/cc/init.cxx b/build2/cc/init.cxx index 698753e..bc598c3 100644 --- a/build2/cc/init.cxx +++ b/build2/cc/init.cxx @@ -209,14 +209,8 @@ namespace build2 // Load bin.*.config for bin.* modules we may need (see core_init() // below). // - if (auto l = rs["config.bin.lib"]) - { - if (cast (l) != "shared") - { - if (!cast_false (rs["bin.ar.config.loaded"])) - load_module (rs, rs, "bin.ar.config", loc); - } - } + if (!cast_false (rs["bin.ar.config.loaded"])) + load_module (rs, rs, "bin.ar.config", loc); if (cid == "msvc") { @@ -281,17 +275,10 @@ namespace build2 const string& cid (cast (rs["cc.id"])); const string& tsys (cast (rs["cc.target.system"])); - // Load the bin.ar module unless we were asked to only build shared - // libraries. + // Load the bin.ar module. // - if (auto l = rs["config.bin.lib"]) - { - if (cast (l) != "shared") - { - if (!cast_false (rs["bin.ar.loaded"])) - load_module (rs, rs, "bin.ar", loc); - } - } + if (!cast_false (rs["bin.ar.loaded"])) + load_module (rs, rs, "bin.ar", loc); // In the VC world you link things directly with link.exe so load the // bin.ld module. diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index c7c7c3c..e4fb6d2 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -380,22 +380,16 @@ namespace build2 r.insert (perform_install_id, x_install, ir); r.insert (perform_uninstall_id, x_uninstall, ir); - // Only register static object/library rules if the bin.ar module is - // loaded (by us or by the user). - // - if (cast_false (rs["bin.ar.loaded"])) - { - r.insert (perform_update_id, x_compile, cr); - r.insert (perform_clean_id, x_compile, cr); - r.insert (configure_update_id, x_compile, cr); + r.insert (perform_update_id, x_compile, cr); + r.insert (perform_clean_id, x_compile, cr); + r.insert (configure_update_id, x_compile, cr); - r.insert (perform_update_id, x_link, lr); - r.insert (perform_clean_id, x_link, lr); - r.insert (configure_update_id, x_link, lr); + r.insert (perform_update_id, x_link, lr); + r.insert (perform_clean_id, x_link, lr); + r.insert (configure_update_id, x_link, lr); - r.insert (perform_install_id, x_install, ir); - r.insert (perform_uninstall_id, x_uninstall, ir); - } + r.insert (perform_install_id, x_install, ir); + r.insert (perform_uninstall_id, x_uninstall, ir); r.insert (perform_update_id, x_compile, cr); r.insert (perform_clean_id, x_compile, cr); -- cgit v1.1