[go: nahoru, domu]

Annotate large GN targets for precompiled headers

Adds the precompiled header config to most large-ish targets in the build, but keeps the config a no-op (so no precompiled headers will be used but this can bw switched with a one-line change).

Removes Windows files from the precompiled header. This does not seem to affect the build speed much because most Chrome files don't depend on Windows any more. And windows.h injects typedefs and defines that conflict with some third party libraries and prevent using precompiled headers for those targets or any target that includes them.

I counted ~50 files or bigger as large. The 50 file threshold is based on some previous approximate measurements (since the precompile step is an extra per-target compile, it can actually make small targets compile slower).

For borderline cases, I added the precompiled header flag if I thought it was likely to have more files added, and didn't add it if I thought the target was likely to be static.

This is a reland of https://codereview.chromium.org/1250273002/ with the config disabled for easier re-landing and iterating
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
TBR=dpranke

Review URL: https://codereview.chromium.org/1258273004

Cr-Commit-Position: refs/heads/master@{#340728}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 67daed5..c4cdb2d1 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -509,6 +509,8 @@
     ]
   }
 
+  configs += [ "//build/config:precompiled_headers" ]
+
   public_deps = [
     "//cc/base",
     "//skia",
@@ -662,6 +664,7 @@
     "test/test_web_graphics_context_3d.h",
   ]
 
+  configs += [ "//build/config:precompiled_headers" ]
   include_dirs = [
     ".",
     "test",
@@ -845,6 +848,7 @@
     "test/run_all_unittests.cc",
   ]
 
+  configs += [ "//build/config:precompiled_headers" ]
   data = [
     "test/data/",
   ]