I’m wondering what the canonical way to enable generation of PDB files for a Release build is?
Naively I’ve just added this to my toolchain file for the MSVC generators:
add_compile_options("$<$`<`CONFIG:Release`>`:/Zi>")
add_link_options("$<$`<`CONFIG:Release`>`:/DEBUG>")
But now I’m re-evaluating some of my CMake configurations and I see that CMAKE_MSVC_DEBUG_INFORMATION_FORMAT is the preferred way to set the /Zi option. However when I do that it only sets the compiler flag and not the required linker /DEBUG flag which actually makes the linker generate the PDB file.
I’ve read through the “Add abstraction for debug info” bug and related links but haven’t found a definitive answer to this, and the issue seems to be stalled?