From 32e04ad4b4a8dec07836b7c9fcf90fe72a006990 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 25 Aug 2018 17:40:21 +0200 Subject: Implement missing pieces in utility libraries support In particular, we can now build static libraries out of utility libraries. --- build2/cc/msvc.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'build2/cc/msvc.cxx') diff --git a/build2/cc/msvc.cxx b/build2/cc/msvc.cxx index 4346872..9eb3de0 100644 --- a/build2/cc/msvc.cxx +++ b/build2/cc/msvc.cxx @@ -65,12 +65,22 @@ namespace build2 { // " Creating library foo\foo.dll.lib and object foo\foo.dll.exp" // - if (lt == otype::s && l.compare (0, 3, " ") == 0) + // This can also appear when linking executables if any of the object + // files export any symbols. + // + if (l.compare (0, 3, " ") == 0) { - path imp (t.member->as ().path ().leaf ()); + // Use the actual import library name if this is a library (since we + // override this name) and the executable name otherwise (by default + // .lib/.exp are named by replacing the .exe extension). + // + path i ( + lt == otype::s + ? t.member->as ().path ().leaf () + : t.path ().leaf ().base () + ".lib"); - if (l.find (imp.string ()) != string::npos && - l.find (imp.base ().string () + ".exp") != string::npos) + if (l.find (i.string ()) != string::npos && + l.find (i.base ().string () + ".exp") != string::npos) continue; } -- cgit v1.1