From d402bc96297c6ed3dd6ee883dcff8cc39bd01030 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Jan 2017 13:50:58 +0200 Subject: Ignore prerequisite mtimes that are not linker inputs This makes sure, for example, that we don't unnecessarily re-link an executable when its testscript prerequisite is changes. --- build2/cli/rule.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index 5b78723..b97bea2 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -231,12 +231,18 @@ namespace build2 { cli_cxx& t (static_cast (xt)); - // Execute our prerequsites and check if we are out of date. + // Update prerequisites and determine if any relevant ones render us + // out-of-date. Note that currently we treat all the prerequisites + // as potentially affecting the result (think prologues/epilogues, + // etc). // - cli* s (execute_prerequisites (a, t, t.mtime ())); + cli* s; + { + auto p (execute_prerequisites (a, t, t.mtime ())); - if (s == nullptr) - return target_state::unchanged; + if ((s = p.first) == nullptr) + return p.second; + } // Translate paths to relative (to working directory). This // results in easier to read diagnostics. -- cgit v1.1