Description
Is there a debug flag being set incorrectly here?
The flag /Z7 appears to be (incorrectly imo) set for release configurations.
https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=vs-2019
Same applies:
Proposed solution
The /Z7 flag is removed from the variables highlighted above.
Additional context
I am interested to find out if there is a genuine reason for setting /Z7 in release configurations as my general understanding is that it is not required and would appear arbitrary.
Thanks!
I think we should have the ability to override /Z7. Unfortunately there's no strip function in Windows, so you're stuck with debug information in static libraries.
Whoops, looks like I accidentally unassigned @grdowns from this issue. @NancyLi1013 or @grdowns - can you fix my mistake?
I am interested to find out if there is a genuine reason for setting /Z7 in release configurations as my general understanding is that it is not required and would appear arbitrary.
Without it, we won't have debugging information for libraries in release.
@BillyONeal
Could you please help take a look about this issue?
Thanks.
What @KindDragon said. There's no reason to remove debugging information; we believe CMake's default setting which includes not even stripped symbols in release mode is an incorrect default. Notably, Windows turning on debug information never increases the size of the resulting program, only in the worst case some intermediate files. All our debugging bits end up going into a PDB, and you always want PDBs even in release builds so that you can interpret stack traces etc. later.
Thanks for your detailed explanation to this issue. @BillyONeal