build: emit pdbs on mingw
Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
parent
4d70d4cafe
commit
dac73b394a
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue