aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-21 15:50:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-21 15:50:38 +0200
commitf2ff3a70fdbe72939dbe55e3ac51949bd00c297c (patch)
tree3e0eb7f6e2fd9ea42e35b14517cf0ebbd90017e9 /libbuild2/cc
parentbabc3f9ddacfd7d8d39ab72e3f134a4978adbfe1 (diff)
Build thin archives for utility libraries if using llvm-lib
Diffstat (limited to 'libbuild2/cc')
-rw-r--r--libbuild2/cc/link-rule.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 16a4ce7..71d609d 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -2188,6 +2188,19 @@ namespace build2
// Add /MACHINE.
//
args.push_back (msvc_machine (cast<string> (rs[x_target_cpu])));
+
+ // For utility libraries use thin archives if possible.
+ //
+ // LLVM's lib replacement had the /LLVMLIBTHIN option at least from
+ // version 3.8 so we will assume always.
+ //
+ if (lt.utility)
+ {
+ const string& id (cast<string> (rs["bin.ar.id"]));
+
+ if (id == "msvc-llvm")
+ args.push_back ("/LLVMLIBTHIN");
+ }
}
else
{