aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-02 15:32:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-02 15:32:42 +0200
commit2069cbb8f72bceb0fcb968ba05968a24eeb0c15d (patch)
treeefbbe802bdf11c21fd9fb1943acf9c8beb9c59ed
parent9fa4b867890dfaa3fa086affec23049826765dfe (diff)
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.
-rw-r--r--build2/cc/init.cxx23
-rw-r--r--build2/cc/module.cxx22
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<string> (l) != "shared")
- {
- if (!cast_false<bool> (rs["bin.ar.config.loaded"]))
- load_module (rs, rs, "bin.ar.config", loc);
- }
- }
+ if (!cast_false<bool> (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<string> (rs["cc.id"]));
const string& tsys (cast<string> (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<string> (l) != "shared")
- {
- if (!cast_false<bool> (rs["bin.ar.loaded"]))
- load_module (rs, rs, "bin.ar", loc);
- }
- }
+ if (!cast_false<bool> (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<exe> (perform_install_id, x_install, ir);
r.insert<exe> (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<bool> (rs["bin.ar.loaded"]))
- {
- r.insert<obja> (perform_update_id, x_compile, cr);
- r.insert<obja> (perform_clean_id, x_compile, cr);
- r.insert<obja> (configure_update_id, x_compile, cr);
+ r.insert<obja> (perform_update_id, x_compile, cr);
+ r.insert<obja> (perform_clean_id, x_compile, cr);
+ r.insert<obja> (configure_update_id, x_compile, cr);
- r.insert<liba> (perform_update_id, x_link, lr);
- r.insert<liba> (perform_clean_id, x_link, lr);
- r.insert<liba> (configure_update_id, x_link, lr);
+ r.insert<liba> (perform_update_id, x_link, lr);
+ r.insert<liba> (perform_clean_id, x_link, lr);
+ r.insert<liba> (configure_update_id, x_link, lr);
- r.insert<liba> (perform_install_id, x_install, ir);
- r.insert<liba> (perform_uninstall_id, x_uninstall, ir);
- }
+ r.insert<liba> (perform_install_id, x_install, ir);
+ r.insert<liba> (perform_uninstall_id, x_uninstall, ir);
r.insert<objs> (perform_update_id, x_compile, cr);
r.insert<objs> (perform_clean_id, x_compile, cr);