Chromium Code Reviews| Index: build/config/BUILD.gn |
| diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn |
| index 9fc86fd2703a36aa877d146a9b158b900e94a577..f0c889c279928af1a423013b4a34545d68f4a44a 100644 |
| --- a/build/config/BUILD.gn |
| +++ b/build/config/BUILD.gn |
| @@ -396,3 +396,31 @@ config("default_libs") { |
| libs = [ "dl" ] |
| } |
| } |
| + |
| +# Add this config to your target to enable precompiled headers. |
| +# |
| +# On Windows, precompiled headers are done on a per-target basis. If you have |
| +# just a couple of files, the time it takes to precompile (~2 seconds) can |
| +# actually be longer than the time saved. On a Z620, a 100 file target compiles |
| +# about 2 seconds faster with precompiled headers, with greater savings for |
| +# larger targets. |
| +# |
| +# Reccommend precompiled headers for targets with more than 50 .cc files. |
|
scottmg
2015/06/29 21:49:16
"Recommend"
|
| +config("precompiled_headers") { |
| + # TODO(brettw) enable this when GN support in the binary has been rolled. |
| + #if (is_win) { |
| + if (false) { |
| + # This is a string rather than a file GN knows about. It has to match |
| + # exactly what's in the /FI flag below, and what might appear in the source |
| + # code in quotes for an #include directive. |
| + precompiled_header = "build/precompile.h" |
| + |
| + # This is a file that GN will compile with the above header. It will be |
| + # implicitly added to the sources (potentially multiple times, with one |
| + # variant for each language used in the target). |
| + precompiled_source = "//build/precompile.cc" |
| + |
| + # Force include the header. |
| + cflags = [ "/FI$precompiled_header" ] |
| + } |
| +} |