gn build: Windows: write PDBs when is_debug
authorDavid Major <dmajor@mozilla.com>
Mon, 4 Feb 2019 21:13:43 +0000 (21:13 +0000)
committerDavid Major <dmajor@mozilla.com>
Mon, 4 Feb 2019 21:13:43 +0000 (21:13 +0000)
Without /DEBUG, the /Zi doesn't on its own create PDB files.

And since ninja runs multiple compilations in parallel, we need /FS to prevent contention on PDBs.

Differential Revision: https://reviews.llvm.org/D57612

llvm-svn: 353093

llvm/utils/gn/build/BUILD.gn

index cd22d21..e33cde2 100644 (file)
@@ -34,7 +34,11 @@ config("compiler_defaults") {
     ]
   } else {
     if (is_debug) {
-      cflags += [ "/Zi" ]
+      cflags += [
+        "/Zi",
+        "/FS",
+      ]
+      ldflags += [ "/DEBUG" ]
     } else {
       cflags += [
         "/O2",
@@ -57,7 +61,7 @@ config("compiler_defaults") {
 
     # The MSVC default value (1 MB) is not enough for parsing recursive C++
     # templates in Clang.
-    ldflags = [ "/STACK:10000000" ]
+    ldflags += [ "/STACK:10000000" ]
   }
 
   # Warning setup.