aboutsummaryrefslogtreecommitdiff
path: root/build/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
commitbbd0f3bb21442a2833916110cbe8e9a07e9f4c1f (patch)
treed25de6f2bcfa4b6cabe1fd55a1b8f508005de4c1 /build/rule.cxx
parent729b56300c441a0d63c7d2013eb5a881211d352b (diff)
Essential install module functionality
Diffstat (limited to 'build/rule.cxx')
-rw-r--r--build/rule.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/build/rule.cxx b/build/rule.cxx
index 82ce993..9f17a2c 100644
--- a/build/rule.cxx
+++ b/build/rule.cxx
@@ -88,13 +88,19 @@ namespace build
if (a.operation () == clean_id)
return noop_recipe;
+ // If we have no prerequisites, then this means this file
+ // is up to date. Return noop_recipe which will also cause
+ // the target's state to be set to unchanged. This is an
+ // important optimization on which quite a few places that
+ // deal with predominantly static content rely.
+ //
+ if (!t.has_prerequisites ())
+ return noop_recipe;
+
// Search and match all the prerequisites.
//
search_and_match_prerequisites (a, t);
-
- return a == perform_update_id
- ? &perform_update
- : t.has_prerequisites () ? default_recipe : noop_recipe;
+ return a == perform_update_id ? &perform_update : default_recipe;
}
target_state file_rule::