aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-12-11 11:00:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-12-11 11:00:00 +0200
commit2a9607c1648a39210012139e62e07fce790badde (patch)
treeb399facc186c68957f1306cf6c720969eb4a0b23 /libbuild2
parent924baeff837ea5b6fde5f6207991ccd2bb807d9a (diff)
Instrument target::newer() with additional debug information
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/target.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx
index 39b81e7..2e1c65e 100644
--- a/libbuild2/target.ixx
+++ b/libbuild2/target.ixx
@@ -769,7 +769,19 @@ namespace build2
inline bool mtime_target::
newer (timestamp mt, target_state s) const
{
+#ifndef NDEBUG
+ // @@ TMP
+ //
+ if (s == target_state::unknown)
+ {
+ text << "unknown target_state in newer(): " << *this <<
+ info << "phase: " << ctx.phase;
+
+ terminate (true /* trace */);
+ }
+
assert (s != target_state::unknown); // Should be executed.
+#endif
timestamp mp (mtime ());