diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-18 13:50:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-18 13:50:58 +0200 |
commit | d402bc96297c6ed3dd6ee883dcff8cc39bd01030 (patch) | |
tree | 634d397f48022935926e26123c13ab8adad6796e /build2/cli | |
parent | 34be21a72a396240642acf3050eead875d3ed4b4 (diff) |
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.
Diffstat (limited to 'build2/cli')
-rw-r--r-- | build2/cli/rule.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
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<cli_cxx&> (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<cli> (a, t, t.mtime ())); + cli* s; + { + auto p (execute_prerequisites<cli> (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. |