Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 4cc958c8ac437f7d7a5f9a065fb574e61a68baf7..4b3c2644ce4c1c3bfad1e4c096efd329d1b1d467 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 |