aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dyndep.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-07-20 10:17:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-07-20 10:17:03 +0200
commitd3ef150c45d9325bc075d33a00c8cf0a6b1bf954 (patch)
tree25ca7cd58d81d8453c6a08f45c0b94ccdfaea03d /libbuild2/dyndep.cxx
parentb61e0de250d522ec9a8e16146ef979a65c181db1 (diff)
Consider unmatched prerequisites in updated_during_match() check
Diffstat (limited to 'libbuild2/dyndep.cxx')
-rw-r--r--libbuild2/dyndep.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/libbuild2/dyndep.cxx b/libbuild2/dyndep.cxx
index c0360f0..e6d0643 100644
--- a/libbuild2/dyndep.cxx
+++ b/libbuild2/dyndep.cxx
@@ -70,19 +70,21 @@ namespace build2
{
const prerequisite_target& p (pts[i]);
- // @@ This currently doesn't cover adhoc targets if matched with
- // buildscript (it stores them in p.data). Probably need to redo
- // things there (see adhoc_buildscript_rule::apply()).
+ // If include_target flag is specified, then p.data contains the
+ // target pointer.
//
- if (p.target != nullptr)
+ if (const target* xt =
+ (p.target != nullptr ? p.target :
+ ((p.include & prerequisite_target::include_target) != 0
+ ? reinterpret_cast<target*> (p.data)
+ : nullptr)))
{
- if (p.target == &pt &&
- (p.include & prerequisite_target::include_udm) != 0)
+ if (xt == &pt && (p.include & prerequisite_target::include_udm) != 0)
return true;
- if (size_t n = p.target->prerequisite_targets[a].size ())
+ if (size_t n = xt->prerequisite_targets[a].size ())
{
- if (updated_during_match (a, *p.target, n, pt))
+ if (updated_during_match (a, *xt, n, pt))
return true;
}
}