aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dyndep.cxx
diff options
context:
space:
mode:
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;
}
}