diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-09-06 19:20:01 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-09-06 19:20:01 +0200 |
commit | 0d275db1433dec9bc7b4fcf5fcd28b42da3b6166 (patch) | |
tree | f0101c7e5ce0ba17b1d4cc3aaecb3bb2c584afc0 /build2/cc/link-rule.cxx | |
parent | d9adcc48df7d5b64427d3b292f9ebfa14461c0f9 (diff) |
Fix issues with interaction between binless logic and Windows DLLs
Diffstat (limited to 'build2/cc/link-rule.cxx')
-rw-r--r-- | build2/cc/link-rule.cxx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index a2f2381..138ae9d 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1238,6 +1238,12 @@ namespace build2 // Linking a library to a shared library or executable. // + // Note: on Windows shared library could be the DLL with unknown + // location (empty path). See search_library() for details. + // + if (l->path ().empty () && l->member != nullptr) // Binless. + return; + // On Windows a shared library is a DLL with the import library as // a first ad hoc group member. MinGW though can link directly to // DLLs (see search_library() for details). @@ -1247,9 +1253,6 @@ namespace build2 tclass == "windows") l = &l->member->as<file> (); - if (l->path ().empty ()) // Binless. - return; - string p (relative (l->path ()).string ()); if (f & lflag_whole) @@ -1349,6 +1352,16 @@ namespace build2 if (d.li.type == otype::a && !lu) return; + // Note: on Windows shared library could be the DLL with unknown + // location (empty path). See search_library() for details. + // + if (l->path ().empty () && l->member != nullptr) // Binless. + return; + + // Check if this library renders us out of date. + // + d.update = d.update || l->newer (d.mt); + // On Windows a shared library is a DLL with the import library as a // first ad hoc group member. MinGW though can link directly to DLLs // (see search_library() for details). @@ -1358,13 +1371,6 @@ namespace build2 tclass == "windows") l = &l->member->as<file> (); - if (l->path ().empty ()) // Binless. - return; - - // Check if this library renders us out of date. - // - d.update = d.update || l->newer (d.mt); - d.cs.append (f); hash_path (d.cs, l->path (), d.out_root); } |