* Add debug information for crash dumps. /Zi flag was missing and dumps did not contain useful info for debugging in non-assembler mode.

* Generate dump for Release by default
This commit is contained in:
HarpyWar 2018-05-07 23:57:58 +03:00
parent 2e2232c4c1
commit 4d1025dd9d

View file

@ -48,6 +48,24 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
endif()
# DEBUG compiler flags:
# /Zi create debugging information PDB file
# /Od disable optimizations
# /Oy- do not suppress frame pointers (recommended for debugging)
# /MTd use statically linked, thread-safe, debug CRT libs (Magic Builder set this flag when build)
#
# RELEASE compiler flags:
# /MT use statically linked, thread-safe CRT libs (Magic Builder set this flag when build)
# /GS- no Buffer Security Check
#
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi /Od /Oy-")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
# Explaining of linker flags and why enable pdb with debug info for Release build is on:
# https://www.wintellect.com/correctly-creating-native-c-release-build-pdbs
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
subdirs(src conf man files)
if(WITH_LUA)
add_subdirectory(lua)