From f2ff3a70fdbe72939dbe55e3ac51949bd00c297c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Oct 2019 15:50:38 +0200 Subject: Build thin archives for utility libraries if using llvm-lib --- libbuild2/cc/link-rule.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libbuild2/cc/link-rule.cxx') 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 (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 (rs["bin.ar.id"])); + + if (id == "msvc-llvm") + args.push_back ("/LLVMLIBTHIN"); + } } else { -- cgit v1.1