aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/windows-rpath.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-08-05 15:26:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-08-05 15:26:45 +0200
commitc5f14c1735d1eb1c7df29515da78e3acde15a5a3 (patch)
treeebf1ba81e1eabac7d3e3253f7c2401a92c577160 /libbuild2/cc/windows-rpath.cxx
parent3f10e86873306e443159d3b8296eb024461e5c2f (diff)
Implement traversal pruning in process_libraries()
Diffstat (limited to 'libbuild2/cc/windows-rpath.cxx')
-rw-r--r--libbuild2/cc/windows-rpath.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/libbuild2/cc/windows-rpath.cxx b/libbuild2/cc/windows-rpath.cxx
index 7b572df..d4d2dc6 100644
--- a/libbuild2/cc/windows-rpath.cxx
+++ b/libbuild2/cc/windows-rpath.cxx
@@ -53,6 +53,9 @@ namespace build2
{
timestamp r (timestamp_nonexistent);
+ //@@ TODO: implement duplicate suppression and prunning. Reuse
+ // rpath_libraries()'s machinery.
+
// We need to collect all the DLLs, so go into implementation of both
// shared and static (in case they depend on shared).
//
@@ -69,9 +72,9 @@ namespace build2
// We don't rpath system libraries.
//
if (sys)
- return;
+ return false;
- // Skip static libraries.
+ // Ignore static libraries.
//
if (l != nullptr)
{
@@ -110,8 +113,11 @@ namespace build2
}
}
}
+
+ return true;
};
+ library_cache lib_cache;
for (const prerequisite_target& pt: t.prerequisite_targets[a])
{
if (pt.adhoc || pt == nullptr)
@@ -125,7 +131,8 @@ namespace build2
( f = pt->is_a<libs> ()))
process_libraries (a, bs, li, sys_lib_dirs,
*f, la, pt.data,
- imp, lib, nullptr, true);
+ imp, lib, nullptr, true /* self */,
+ &lib_cache);
}
return r;
@@ -142,6 +149,8 @@ namespace build2
{
windows_dlls r;
+ //@@ TODO: implement duplicate suppression and prunning.
+
auto imp = [] (const target&, bool) {return true;};
auto lib = [&r, &bs] (
@@ -153,7 +162,7 @@ namespace build2
const file* l (lc != nullptr ? &(*lc)->as<file> () : nullptr);
if (sys)
- return;
+ return false;
if (l != nullptr)
{
@@ -209,8 +218,11 @@ namespace build2
}
}
}
+
+ return true;
};
+ library_cache lib_cache;
for (const prerequisite_target& pt: t.prerequisite_targets[a])
{
if (pt.adhoc || pt == nullptr)
@@ -224,7 +236,8 @@ namespace build2
( f = pt->is_a<libs> ()))
process_libraries (a, bs, li, sys_lib_dirs,
*f, la, pt.data,
- imp, lib, nullptr, true);
+ imp, lib, nullptr, true /* self */,
+ &lib_cache);
}
return r;