diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-25 17:40:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-25 17:40:21 +0200 |
commit | 32e04ad4b4a8dec07836b7c9fcf90fe72a006990 (patch) | |
tree | 8a0ce76d3a2f644396348fbf0d3d5d00bab82a0c /build2/cc/msvc.cxx | |
parent | 236497a013790c879e9e798bd68083252b43b057 (diff) |
Implement missing pieces in utility libraries support
In particular, we can now build static libraries out of utility libraries.
Diffstat (limited to 'build2/cc/msvc.cxx')
-rw-r--r-- | build2/cc/msvc.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
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<file> ().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<file> ().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; } |