aboutsummaryrefslogtreecommitdiff
path: root/build/bin/rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/bin/rule.cxx')
-rw-r--r--build/bin/rule.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/build/bin/rule.cxx b/build/bin/rule.cxx
index 0fc0e40..0eb8363 100644
--- a/build/bin/rule.cxx
+++ b/build/bin/rule.cxx
@@ -114,15 +114,25 @@ namespace build
if (current_mode == execution_mode::last)
swap (m1, m2);
- target_state ts (target_state::unchanged);
+ target_state r (target_state::unchanged), ts;
- if (m1 != nullptr && execute (a, *m1) == target_state::changed)
- ts = target_state::changed;
+ if (m1 != nullptr)
+ {
+ ts = execute (a, *m1);
+ if (ts == target_state::changed ||
+ (ts == target_state::postponed && r == target_state::unchanged))
+ r = ts;
+ }
- if (m2 != nullptr && execute (a, *m2) == target_state::changed)
- ts = target_state::changed;
+ if (m2 != nullptr)
+ {
+ ts = execute (a, *m2);
+ if (ts == target_state::changed ||
+ (ts == target_state::postponed && r == target_state::unchanged))
+ r = ts;
+ }
- return ts;
+ return r;
}
}
}