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-Original-Commit-Position: refs/heads/master@{#306945}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9261dde33f1939f432cafe6f9654efedba4dc252
This commit is contained in:
Nico Weber 2014-12-04 16:49:06 -08:00
Родитель 132efefe34
Коммит e0ab7c5025
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -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)'],

Просмотреть файл

@ -381,6 +381,7 @@ template("grit") {
".",
"--depfile",
rebase_path(depfile, root_build_dir),
"--write-only-new=1"
] + grit_defines
# Add extra defines with -D flags.