From 58a05fc84029acdb711b40cf2cee09a0b2202bf7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Sep 2018 17:57:46 +0200 Subject: Check for binless-ness after seeing through to import library member This makes a difference for installed libraries since the DLL location might be unknown (empty path). --- build2/cc/link-rule.cxx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index b644174..a2f2381 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1171,9 +1171,6 @@ namespace build2 } else { - if (l->path ().empty ()) // Binless. - return; - bool lu (l->is_a ()); // The utility/non-utility case is tricky. Consider these two @@ -1209,6 +1206,9 @@ namespace build2 if (!lu) return; + if (l->path ().empty ()) // Binless. + return; + for (const target* pt: l->prerequisite_targets[d.a]) { if (pt == nullptr) @@ -1247,6 +1247,9 @@ namespace build2 tclass == "windows") l = &l->member->as (); + if (l->path ().empty ()) // Binless. + return; + string p (relative (l->path ()).string ()); if (f & lflag_whole) @@ -1325,9 +1328,6 @@ namespace build2 } else { - if (l->path ().empty ()) // Binless. - return; - bool lu (l->is_a ()); if (lu) @@ -1349,17 +1349,22 @@ namespace build2 if (d.li.type == otype::a && !lu) 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). // - if (l->member != nullptr && l->is_a () && tclass == "windows") + if (l->member != nullptr && + l->is_a () && + tclass == "windows") l = &l->member->as (); + 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); } -- cgit v1.1