Implements a crash dialog for Windows. The crash popup provides the following actions: - Restart: reopen Blender from the last saved or auto-saved time - Report a Bug: forward to Blender bug tracker - View Crash Log: open the .txt file with the crash log - Close: Closes without any further action Pull Request: https://projects.blender.org/blender/blender/pulls/129974
44 lines
1.1 KiB
CMake
44 lines
1.1 KiB
CMake
# SPDX-FileCopyrightText: 2017 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Build `msgfmt` executable.
|
|
|
|
set(INC
|
|
)
|
|
|
|
set(SRC
|
|
msgfmt.cc
|
|
)
|
|
|
|
# Manifest required for selecting comctl32 v6 required by the crash popup.
|
|
if(WIN32 AND NOT WITH_WINDOWS_EXTERNAL_MANIFEST)
|
|
LIST(APPEND SRC "${CMAKE_BINARY_DIR}/tests.exe.manifest")
|
|
endif()
|
|
|
|
set(LIB
|
|
PRIVATE PRIVATE bf::blenlib
|
|
PRIVATE bf::intern::guardedalloc
|
|
${ZLIB_LIBRARIES}
|
|
${PLATFORM_LINKLIBS})
|
|
|
|
add_cc_flags_custom_test(msgfmt)
|
|
|
|
if(WIN32)
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:MSVCRT.lib")
|
|
list(APPEND LIB bf_intern_utfconv)
|
|
endif()
|
|
|
|
add_executable(msgfmt ${SRC})
|
|
setup_platform_linker_flags(msgfmt)
|
|
blender_target_include_dirs(msgfmt ${INC})
|
|
target_link_libraries(msgfmt ${LIB})
|
|
|
|
# If using an external manifest, copy it to the output directory after building.
|
|
if(WITH_WINDOWS_EXTERNAL_MANIFEST)
|
|
add_custom_command(TARGET msgfmt POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/tests.exe.manifest $<TARGET_FILE_DIR:msgfmt>/$<TARGET_FILE_NAME:msgfmt>.manifest
|
|
)
|
|
endif()
|