aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/compile-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-16 06:07:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-16 06:08:59 +0200
commit6f0ad0bc49ae94d864e1c40aec38754d337b0cab (patch)
treecd6f0d6102d231a0994d9ac9143d06b669aff86b /libbuild2/cc/compile-rule.cxx
parentd8915d75e9422104e7f6c4a83f39023ab399d34b (diff)
Minor optimizations in cc::compile_rule
Diffstat (limited to 'libbuild2/cc/compile-rule.cxx')
-rw-r--r--libbuild2/cc/compile-rule.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index 6258ce8..87fce90 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -230,7 +230,6 @@ namespace build2
struct compile_rule::match_data
{
- explicit
match_data (unit_type t, const prerequisite_member& s)
: type (t), src (s) {}
@@ -6987,9 +6986,6 @@ namespace build2
},
md.modules.copied)); // See search_modules() for details.
- const file& s (pr.second);
- const path* sp (&s.path ());
-
// Force recompilation in case of a deferred failure even if nothing
// changed.
//
@@ -7006,11 +7002,14 @@ namespace build2
return *pr.first;
}
+ const file& s (pr.second);
+ const path* sp (&s.path ());
+
// Make sure depdb is no older than any of our prerequisites (see md.mt
// 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 ()
+ timestamp start (!ctx.dry_run && depdb::mtime_check ()
? system_clock::now ()
: timestamp_unknown);