Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt

* 'master' of https://github.com/tildearrow/furnace:
  fudge and bread
  what?!
This commit is contained in:
cam900 2022-05-29 13:50:09 +09:00
commit 131081a030
3 changed files with 23 additions and 1 deletions

View file

@ -517,10 +517,13 @@ 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()
message(STATUS "Using backward-cpp")
else()
message(STATUS "Not using backward-cpp")
endif()
if (BUILD_GUI)

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