aboutsummaryrefslogtreecommitdiff
path: root/build2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-28 11:11:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-28 11:11:10 +0200
commit8901004f9e783fb3a30e2ddb1e69e8f8a7d085f5 (patch)
tree11d4b80a099d1dcea5404ec45c52201d9ec23b38 /build2/cc
parent9190569b69e34468841b18b33c98f78e66a3d26e (diff)
Add --[no-]mtime-check options to control this behavior at runtime
By default the checks are enabled only for the staged toolchain.
Diffstat (limited to 'build2/cc')
-rw-r--r--build2/cc/compile-rule.cxx9
-rw-r--r--build2/cc/link-rule.cxx2
2 files changed, 8 insertions, 3 deletions
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index 9326193..897a9f1 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -4250,8 +4250,13 @@ namespace build2
}
// Make sure depdb is no older than any of our prerequisites (see md.mt
- // logic description above for details).
+ // logic description above for details). Also save the sequence start
+ // time if doing mtime checks (see the depdb::check_mtime() call below).
//
+ timestamp start (depdb::mtime_check ()
+ ? system_clock::now ()
+ : timestamp_unknown);
+
touch (md.dd, false, verb_never);
const scope& bs (t.base_scope ());
@@ -4670,7 +4675,7 @@ namespace build2
}
timestamp now (system_clock::now ());
- depdb::verify (timestamp_unknown, md.dd, tp, now);
+ depdb::check_mtime (start, md.dd, tp, now);
// Should we go to the filesystem and get the new mtime? We know the
// file has been modified, so instead just use the current clock time.
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index 47c058d..ca51700 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -2554,7 +2554,7 @@ namespace build2
}
rm.cancel ();
- dd.verify (tp);
+ dd.check_mtime (tp);
// Should we go to the filesystem and get the new mtime? We know the
// file has been modified, so instead just use the current clock time.