aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-05-29 07:56:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-05-29 14:12:00 +0200
commit9bea2f465cc2b47e06d65d6a29cb0f0f0c37f29c (patch)
tree5eb14ac196fce453c33c06c497e25b8d8f9259a1 /libbuild2/operation.cxx
parent59014204d94e67d243cce45ff83ca85212237433 (diff)
Extend special match_rule() logic to all groups with dynamic targets
Diffstat (limited to 'libbuild2/operation.cxx')
-rw-r--r--libbuild2/operation.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/libbuild2/operation.cxx b/libbuild2/operation.cxx
index f199827..7355f38 100644
--- a/libbuild2/operation.cxx
+++ b/libbuild2/operation.cxx
@@ -774,6 +774,21 @@ namespace build2
if (ctx.dependency_count.load (memory_order_relaxed) != 0)
{
+ auto dependents = [base = ctx.count_base ()] (action a,
+ const target& t)
+ {
+ const target::opstate& s (t.state[a]);
+
+ // Only consider targets that have been matched for this operation
+ // (since matching is what causes the dependents count reset).
+ //
+ size_t c (s.task_count.load (memory_order_relaxed) - base);
+
+ return (c >= target::offset_applied
+ ? s.dependents.load (memory_order_relaxed)
+ : 0);
+ };
+
diag_record dr;
dr << info << "detected unexecuted matched targets:";
@@ -781,14 +796,12 @@ namespace build2
{
const target& t (*pt);
- if (size_t n = t[a].dependents.load (memory_order_relaxed))
+ if (size_t n = dependents (a, t))
dr << text << t << ' ' << n;
if (a.outer ())
{
- action ia (a.inner_action ());
-
- if (size_t n = t[ia].dependents.load (memory_order_relaxed))
+ if (size_t n = dependents (a.inner_action (), t))
dr << text << t << ' ' << n;
}
}