Skip to content

Commit d51e721

Browse files
authored
msvc: Fix parallel building when creating PDB debug info (#3471)
The current way of creating debug info, using the -Zi option, writes all debug info to one central file. This doesn't work if building with multiple compiler invocations in parallel. By adding the -FS option, writing of the PDB file is passed via mspdbsrv.exe, allowing multiple concurrent compiler processes. Alternatively, the debug info could be created using the -Z7 flag instead, which stores the debug info within the object files until the linking stage, which also works for parallel compilation.
1 parent 6b9e449 commit d51e721

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/msvc-common.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ endif
3232
CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10
3333
CXX_LINK_O=-nologo -Fe$@
3434
AR_OPTS=-nologo -out:$@
35-
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -GS -Gy -DNDEBUG
36-
CFLAGS_DEBUG=-Od -Oy- -Zi -RTC1 -D_DEBUG
35+
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -FS -GF -GS -Gy -DNDEBUG
36+
CFLAGS_DEBUG=-Od -Oy- -Zi -FS -RTC1 -D_DEBUG
3737
CFLAGS_M32=
3838
CFLAGS_M64=
3939
LINK_LOCAL_DIR=

0 commit comments

Comments
 (0)