diff options
-rw-r--r-- | build2/cc/link-rule.cxx | 27 |
1 files 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<libux> ()); // 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<file> (); + 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<libux> ()); 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<libs> () && tclass == "windows") + if (l->member != nullptr && + l->is_a<libs> () && + 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); } |