aboutsummaryrefslogtreecommitdiff
path: root/build2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-03 10:05:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-03 10:05:16 +0200
commitbcb5045dff9e87decbad3a785eb1fe42f4fc1410 (patch)
treed5ed2b39f3704e28f0707b61cd50114cfe775d4c /build2/operation.cxx
parent2069cbb8f72bceb0fcb968ba05968a24eeb0c15d (diff)
Use final action state after match at top level (operation)
Diffstat (limited to 'build2/operation.cxx')
-rw-r--r--build2/operation.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/build2/operation.cxx b/build2/operation.cxx
index 1fe70df..ff2051d 100644
--- a/build2/operation.cxx
+++ b/build2/operation.cxx
@@ -126,9 +126,20 @@ namespace build2
{
const target& t (*static_cast<const target*> (ts[j]));
- target_state s (j < i
- ? match (a, t, false)
- : target_state::postponed);
+ // Finish matching targets that we have started. Note that we use the
+ // state for the "final" action that will be executed and not our
+ // action. Failed that, we may fail to find a match for a "stronger"
+ // action but will still get unchanged for the original one.
+ //
+ target_state s;
+ if (j < i)
+ {
+ match (a, t, false);
+ s = t.serial_state (false);
+ }
+ else
+ s = target_state::postponed;
+
switch (s)
{
case target_state::postponed: