fudge and bread

This commit is contained in:
tildearrow 2022-05-28 23:40:46 -05:00
parent bf0b207a3d
commit 6afe29682d
3 changed files with 20 additions and 1 deletions

View file

@ -509,7 +509,7 @@ endif()
set(USED_SOURCES ${ENGINE_SOURCES} ${AUDIO_SOURCES} src/main.cpp)
if (USE_BACKWARD)
list(APPEND USED_SOURCES src/backtrace.cpp)
list(APPEND DEPENDENCIES_DEFINES HAVE_BACKWARD)
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND DEPENDENCIES_LIBRARIES dbghelp psapi)
endif()

View file

@ -39,4 +39,12 @@ namespace backward {
backward::SignalHandling sh;
void checkInitialized() {
if (!sh.loaded()) {
#ifdef _WIN32
MessageBox(NULL,"Warning","crash backtrace not available!",MB_OK|MB_ICONWARNING);
#endif
}
}
} // namespace backward

View file

@ -39,6 +39,10 @@
#include "gui/gui.h"
#endif
#ifdef HAVE_BACKWARD
#include "../extern/backward/backward.hpp"
#endif
DivEngine e;
#ifdef HAVE_GUI
@ -242,6 +246,7 @@ void initParams() {
// TODO: CoInitializeEx on Windows?
// TODO: add crash log
int main(int argc, char** argv) {
backward::SignalHandling sh;
initLog();
#if !(defined(__APPLE__) || defined(_WIN32) || defined(ANDROID))
// workaround for Wayland HiDPI issue
@ -301,6 +306,12 @@ int main(int argc, char** argv) {
}
}
if (!sh.loaded()) {
#ifdef _WIN32
MessageBox(NULL,"Warning","crash backtrace not available!",MB_OK|MB_ICONWARNING);
#endif
}
e.setConsoleMode(consoleMode);
#ifdef _WIN32