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

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

Issue 2152783002: Enable precompiled headers for Blink on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up comments 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
« no previous file with comments | « third_party/WebKit/Source/BUILD.gn ('k') | third_party/WebKit/Source/core/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/BUILD.gn
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn
index 3f191eb4fc5b69f40a1a53143ef5a3e4c06a262b..8eff051a5a19c9442ce166b3ffd2219f413ec968 100644
--- a/third_party/WebKit/Source/core/BUILD.gn
+++ b/third_party/WebKit/Source/core/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("//build/config/chrome_build.gni")
import("//build/config/ui.gni")
@@ -64,6 +64,41 @@ config("core_include_dirs") {
}
}
+import("//build/config/pch.gni")
+
+config("blink_core_pch") {
+ if (!disable_precompiled_headers) {
+ 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("win/Precompile-core.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/core/win/Precompile-core.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" ]
+ }
+ }
+}
+
+core_config_add += [ ":blink_core_pch" ]
+
# GYP version: WebKit/Source/core/core.gyp:webcore_generated
source_set("generated") {
deps = [
@@ -288,6 +323,7 @@ source_set("testing") {
configs += [
"//third_party/WebKit/Source:inside_blink",
"//third_party/WebKit/Source:config",
+ ":blink_core_pch",
]
deps = [
@@ -498,7 +534,7 @@ source_set("core_generated") {
}
}
-# core_bindings_generated ------------------------------------------------------
+# core_bindings_generated ------------------------------------------------------
# GYP version: WebKit/Source/core/core_generated.gyp:core_event_interfaces
generate_event_interfaces("core_event_interfaces") {
@@ -506,7 +542,7 @@ generate_event_interfaces("core_event_interfaces") {
output_file = "core/EventInterfaces.in"
}
-# generated_testing_idls -------------------------------------------------------
+# generated_testing_idls -------------------------------------------------------
# GYP version: WebKit/Source/core/core_generated.gyp:generated_testing_idls
group("generated_testing_idls") {
@@ -583,7 +619,7 @@ action("generated_testing_idls_internal_runtime_flags") {
]
}
-# make_core_generated ----------------------------------------------------------
+# make_core_generated ----------------------------------------------------------
# GYP version: WebKit/Source/core/core_generated.gyp:make_core_generated
group("make_core_generated") {
@@ -770,7 +806,7 @@ process_in_files("make_core_generated_svg_element_type_helpers") {
]
}
-# make_event_factory -----------------------------------------------------------
+# make_event_factory -----------------------------------------------------------
# "EventFactory" in make_core_generated from GYP.
process_in_files("make_core_generated_event_factory") {
@@ -787,7 +823,7 @@ process_in_files("make_core_generated_event_factory") {
]
}
-# make_names -------------------------------------------------------------------
+# make_names -------------------------------------------------------------------
# "MediaFeatureNames" in make_core_generated from GYP.
process_in_files("make_core_generated_media_feature_names") {
@@ -863,7 +899,7 @@ make_names("make_core_generated_input_type_names") {
]
}
-# make_qualified_names ---------------------------------------------------------
+# make_qualified_names ---------------------------------------------------------
# "MathMLNames" in make_core_generated from GYP.
make_qualified_names("make_core_generated_math_ml_names") {
@@ -904,7 +940,7 @@ make_qualified_names("make_core_generated_xml_names") {
]
}
-# make_token_matcher -----------------------------------------------------------
+# make_token_matcher -----------------------------------------------------------
# "MakeTokenMatcherForViewport" in make_core_generated from GYP.
make_token_matcher("make_core_generated_make_token_matcher_for_viewport") {
@@ -912,7 +948,7 @@ make_token_matcher("make_core_generated_make_token_matcher_for_viewport") {
output_file = "$blink_core_output_dir/HTMLMetaElement.cpp"
}
-# One-off scripts --------------------------------------------------------------
+# One-off scripts --------------------------------------------------------------
# "generatePrivateScript" in make_core_generated from GYP.
# FIXME: The implementation of Blink-in-JS is not yet mature.
« no previous file with comments | « third_party/WebKit/Source/BUILD.gn ('k') | third_party/WebKit/Source/core/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698