Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: third_party/WebKit/Source/BUILD.gn

Issue 2152783002: Enable precompiled headers for Blink on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/BUILD.gn
diff --git a/third_party/WebKit/Source/BUILD.gn b/third_party/WebKit/Source/BUILD.gn
index cfc9a242330bc1109f3126987b46506b74383119..bfc8a075ef0503b261c8a8922b6a9ca54df693a6 100644
--- a/third_party/WebKit/Source/BUILD.gn
+++ b/third_party/WebKit/Source/BUILD.gn
@@ -1,6 +1,6 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
+# found in the LICENSE file.
import("config.gni")
if (is_clang) {
@@ -9,7 +9,7 @@ if (is_clang) {
visibility = [ "//third_party/WebKit/*" ]
-# arguments --------------------------------------------------------------------
+# arguments --------------------------------------------------------------------
declare_args() {
# Set to true to enable the clang plugin that checks the usage of the Blink
@@ -26,13 +26,13 @@ declare_args() {
blink_gc_plugin_option_warn_unneeded_finalizer = false
}
-# features ---------------------------------------------------------------------
+# features ---------------------------------------------------------------------
config("features") {
defines = feature_defines_list
}
-# inside_blink -----------------------------------------------------------------
+# inside_blink -----------------------------------------------------------------
config("inside_blink") {
defines = [
@@ -41,7 +41,46 @@ config("inside_blink") {
]
}
-# config -----------------------------------------------------------------------
+# blink_pch --------------------------------------------------------------------
+
+# Precompiled headers can save a lot of time compiling since Blink has
+# a lot of source in header files.
+
+import("//build/config/pch.gni")
+import("//build/toolchain/goma.gni")
+
+config("blink_pch") {
+ if (!is_official_build && !use_goma && !disable_precompiled_headers) {
Nico 2016/07/14 19:58:52 Rather than repeat all these here, maybe they shou
Daniel Bratell 2016/07/15 06:43:55 I've done that change in the next version but ther
+ if (is_win) {
+ # 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 = rebase_path("build/win/Precompile.h", root_build_dir)
+
+ # 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 =
+ "//third_party/WebKit/Source/build/win/Precompile.cpp"
+
+ # Force include the header.
+ cflags = [ "/FI$precompiled_header" ]
+
+ # Disable warning for "this file was empty after preprocessing". This
+ # error is generated only in C mode for ANSI compatibility. It conflicts
+ # with precompiled headers since the source file that's "compiled" for
+ # making the precompiled header is empty.
+ #
+ # This error doesn't happen every time. In VS2013, it seems if the .pch
+ # file doesn't exist, no error will be generated (probably MS tested this
+ # case but forgot the other one?). To reproduce this error, do a build,
+ # then delete the precompile.c.obj file, then build again.
+ cflags_c = [ "/wd4206" ]
+ }
+ }
+}
+
+# config -----------------------------------------------------------------------
config("config") {
include_dirs = [

Powered by Google App Engine
This is Rietveld 408576698