From 9261dde33f1939f432cafe6f9654efedba4dc252 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 4 Dec 2014 16:49:06 -0800 Subject: grit: Use new --write-only-new flag. For the file I'm testing with (c/b/resources/about_stats.html), a rebuild runs 101 edges and compiles a bunch of cc files and takes 40s. This reduces build times from 40s to 9.6s and reduces the number of edges to 37. BUG=439182 R=brettw@chromium.org Review URL: https://codereview.chromium.org/740463005 Cr-Commit-Position: refs/heads/master@{#306945} --- build/grit_action.gypi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'build/grit_action.gypi') diff --git a/build/grit_action.gypi b/build/grit_action.gypi index ab7a70b..15ead28 100644 --- a/build/grit_action.gypi +++ b/build/grit_action.gypi @@ -21,6 +21,20 @@ # instead of build/common.gypi . 'grit_additional_defines%': [], 'grit_rc_header_format%': [], + + 'conditions': [ + # These scripts can skip writing generated files if they are identical + # to the already existing files, which avoids further build steps, like + # recompilation. However, a dependency (earlier build step) having a + # newer timestamp than an output (later build step) confuses some build + # systems, so only use this on ninja, which explicitly supports this use + # case (gyp turns all actions into ninja restat rules). + ['"<(GENERATOR)"=="ninja"', { + 'write_only_new': '1', + }, { + 'write_only_new': '0', + }], + ], }, 'inputs': [ '