summaryrefslogtreecommitdiffstats
path: root/build/grit_action.gypi
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-12-04 16:49:06 -0800
committerNico Weber <thakis@chromium.org>2014-12-05 00:50:15 +0000
commit9261dde33f1939f432cafe6f9654efedba4dc252 (patch)
treeb3947e8f6899b33c364a0e63b77441da9e3307fc /build/grit_action.gypi
parent89b02d7db9f1d1f98f65040535b5acc59aadaab0 (diff)
downloadchromium_src-9261dde33f1939f432cafe6f9654efedba4dc252.zip
chromium_src-9261dde33f1939f432cafe6f9654efedba4dc252.tar.gz
chromium_src-9261dde33f1939f432cafe6f9654efedba4dc252.tar.bz2
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}
Diffstat (limited to 'build/grit_action.gypi')
-rw-r--r--build/grit_action.gypi15
1 files changed, 15 insertions, 0 deletions
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': [
'<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
@@ -35,6 +49,7 @@
'-i', '<(grit_grd_file)', 'build',
'-f', '<(grit_resource_ids)',
'-o', '<(grit_out_dir)',
+ '--write-only-new=<(write_only_new)',
'<@(grit_defines)',
'<@(grit_additional_defines)',
'<@(grit_rc_header_format)'],