From bbd0f3bb21442a2833916110cbe8e9a07e9f4c1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Jul 2015 12:52:20 +0200 Subject: Essential install module functionality --- build/rule.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'build/rule.cxx') 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:: -- cgit v1.1