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

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

Issue 2520863002: Enable precompiled headers for Blink on Windows. (Closed)
Patch Set: rebased Created 4 years, 1 month 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/win/Precompile.cpp ('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 55f4fbf7bef57f3fa736fbb60e96e247cd137881..0c58627a1145a40ced541856118442d19135c7d8 100644
--- a/third_party/WebKit/Source/core/BUILD.gn
+++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -48,6 +48,41 @@ config("core_include_dirs") {
}
}
+import("//build/config/pch.gni")
+
+config("blink_core_pch") {
+ if (enable_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" ]
+
source_set("generated") {
deps = [
":core_generated",
@@ -201,8 +236,9 @@ component("core") {
source_set("testing") {
configs += [
- "//third_party/WebKit/Source:inside_blink",
+ ":blink_core_pch",
"//third_party/WebKit/Source:config",
+ "//third_party/WebKit/Source:inside_blink",
]
deps = [
@@ -1316,6 +1352,7 @@ source_set("unit_tests") {
]
configs += [
+ ":blink_core_pch",
"//third_party/WebKit/Source:config",
"//third_party/WebKit/Source:inside_blink",
]
« no previous file with comments | « third_party/WebKit/Source/build/win/Precompile.cpp ('k') | third_party/WebKit/Source/core/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698