aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-buildscript.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/adhoc-rule-buildscript.cxx
parentb61e0de250d522ec9a8e16146ef979a65c181db1 (diff)
Consider unmatched prerequisites in updated_during_match() check
Diffstat (limited to 'libbuild2/adhoc-rule-buildscript.cxx')
-rw-r--r--libbuild2/adhoc-rule-buildscript.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/libbuild2/adhoc-rule-buildscript.cxx b/libbuild2/adhoc-rule-buildscript.cxx
index ab5706c..fd0411f 100644
--- a/libbuild2/adhoc-rule-buildscript.cxx
+++ b/libbuild2/adhoc-rule-buildscript.cxx
@@ -543,8 +543,22 @@ namespace build2
// information (e.g., poptions from a library) and those will be
// change-tracked.
//
+ // Note: set the include_target flag for the updated_during_match()
+ // check.
+ //
if (mr.first)
+ {
+ pt.data = reinterpret_cast<uintptr_t> (pt.target);
pt.target = nullptr;
+ pt.include |= prerequisite_target::include_target;
+
+ // Note that this prerequisite could also be ad hoc and we must
+ // clear that flag if we managed to unmatch (failed that we will
+ // treat it as ordinary ad hoc since it has the target pointer in
+ // data).
+ //
+ pt.include &= ~prerequisite_target::include_adhoc;
+ }
else
pt.include |= prerequisite_target::include_adhoc;
}
@@ -828,9 +842,7 @@ namespace build2
// them to the auxiliary data member in prerequisite_target (see
// execute_update_prerequisites() for details).
//
- // @@ This actually messes up with updated_during_match() check. Could
- // we not redo this so that we always keep p.target intact? Can't
- // we just omit p.adhoc() targets from $<?
+ // Note: set the include_target flag for the updated_during_match() check.
//
for (prerequisite_target& p: pts)
{
@@ -840,6 +852,7 @@ namespace build2
{
p.data = reinterpret_cast<uintptr_t> (p.target);
p.target = nullptr;
+ p.include |= prerequisite_target::include_target;
}
}
@@ -1898,6 +1911,7 @@ namespace build2
// !NULL false 1 - normal prerequisite already updated
// !NULL true 0 - ad hoc prerequisite to be updated and blanked
// NULL true !NULL - ad hoc prerequisite already updated and blanked
+ // NULL false !NULL - unmatched prerequisite (ignored by this function)
//
// Note that we still execute already updated prerequisites to keep the
// dependency counts straight. But we don't consider them for the "renders
@@ -1972,10 +1986,14 @@ namespace build2
// Blank out adhoc.
//
+ // Note: set the include_target flag for the updated_during_match()
+ // check.
+ //
if (p.adhoc ())
{
p.data = reinterpret_cast<uintptr_t> (p.target);
p.target = nullptr;
+ p.include |= prerequisite_target::include_target;
}
}
}