There are several different debug flags you can use with the Visual Studio C++ compiler. They are:
/Z7
keeps the debug info in the .obj files in CodeView format and lets the linker extract them into a .pdb while /Zi
consolidates it into a common .pdb file during compilation already by sync'ing with mspdbsrv.exe.
So /Z7
means more file IO, disc space being used and more work for the linker as there is lots of duplicate debug info in these obj files. But it also means every compilation is independent and thus can actually still be faster than /Zi
with enough parallelization.
By now they've improved the /Zi
situation though by reducing the inter-process communication with mspdbsrv.exe: https://docs.microsoft.com/en-us/cpp/build/reference/zf
Another use-case of /Z7
is for "standalone" (though larger) static libraries that don't require shipping a separate .pdb
if you want that. That also prevents the annoying issues arising from the awful default vcxxx.pdb
name cl uses as long as you don't fix it with a proper https://docs.microsoft.com/en-us/cpp/build/reference/fd-program-database-file-name, which most people forget.
/ZI
is like /Zi
but adds additional data etc. to make the Edit and Continue feature work.