build: emit pdbs on mingw

Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
seth 2025-06-30 14:54:06 -04:00 committed by Seth Flynn
parent 4d70d4cafe
commit dac73b394a
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86

View file

@ -79,6 +79,15 @@ else()
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}")
# Emit PDBs for WinDbg, etc.
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--pdb= ${CMAKE_EXE_LINKER_FLAGS}")
foreach(lang C CXX)
set("CMAKE_${lang}_FLAGS" "-gcodeview ${CMAKE_${lang}_FLAGS}")
endforeach()
endif()
# -ffunction-sections and -fdata-sections help reduce binary size
# -mguard=cf enables Control Flow Guard
# TODO: Look into -gc-sections to further reduce binary size