Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index e006f3bdaa54c5ef751747c615d17735c30f9ed6..73d2f7f95502aafdeb5ccd1efe8b5586b7ef377e 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -108,6 +108,12 @@ config("compiler") { |
"/FS", # Preserve previous PDB behavior. |
] |
+ # Force C/C++ mode for the given GN detected file type. This is necessary |
+ # for precompiled headers where the same source file is compiled in both |
+ # modes. |
+ cflags_c += [ "/TC" ] |
+ cflags_cc += [ "/TP" ] |
+ |
# Building with Clang on Windows is a work in progress and very |
# experimental. See crbug.com/82385. |
# Keep this in sync with the similar block in build/common.gypi |