Is there any way to detect when compilation is happening with debugging symbols enabled with the preprocessor? (when using cl.exe)
(Background: Our compile will fail due to toolchain .pdb size limitations, so I'd like to #error earlier rather than have the compile/link fail after a lengthy build.)
When you build the command line for cl.exe, if you decide to pass /Zi
(or whatever option you're using for pdb generation), also pass -D_SYMBOLS_GENERATED
. Then, in the code, just use #if defined(_SYMBOLS_GENERATED)
.