aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-04 17:57:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-09-04 17:57:46 +0200
commit58a05fc84029acdb711b40cf2cee09a0b2202bf7 (patch)
treebbe0f24602a73b8531affffa7aed9f189ada3aa2
parentd0a8c1b417f43184ac60394b35da7990c812acd3 (diff)
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).
-rw-r--r--build2/cc/link-rule.cxx27
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);
}