summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-05-21 15:57:34 +0200
committerJan Dalheimer <jan@dalheimer.de>2014-05-21 15:57:34 +0200
commitfc3c0b09719927fa8e0ce63a93b8f461f4928fdb (patch)
treeed81f15b305da904d63d0e0e74643aa0800a0919 /CMakeLists.txt
parent94cb5c7d770866269d1a61ec6b3c76607eccee6f (diff)
parente6ca58a89e12bb2c7636dac91b6a1a609c6780b3 (diff)
downloadMultiMC-fc3c0b09719927fa8e0ce63a93b8f461f4928fdb.tar
MultiMC-fc3c0b09719927fa8e0ce63a93b8f461f4928fdb.tar.gz
MultiMC-fc3c0b09719927fa8e0ce63a93b8f461f4928fdb.tar.lz
MultiMC-fc3c0b09719927fa8e0ce63a93b8f461f4928fdb.tar.xz
MultiMC-fc3c0b09719927fa8e0ce63a93b8f461f4928fdb.zip
Merge branch 'feature_crashreport' into develop
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 28 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17589f9a..531f7342 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,8 +75,29 @@ if(${BIGENDIAN})
endif(${BIGENDIAN})
-######## Set URLs ########
+######## Dark magic crash reports ########
+option(MultiMC_HANDLE_SEGV "Handle fatal crashes and generate crash reports." OFF)
+set(CRASH_HANDLER_IMPL "")
+message(STATUS "Crash dumps are ${MultiMC_HANDLE_SEGV}")
+if (MultiMC_HANDLE_SEGV)
+ add_definitions(-DHANDLE_SEGV)
+ if (WIN32)
+ find_package(DbgHelp)
+ set(MultiMC_LINK_ADDITIONAL_LIBS "${MultiMC_LINK_ADDITIONAL_LIBS}dbghelp")
+ set(MultiMC_CRASH_HANDLER_EXTRA_H "WinBacktrace.h")
+ set(MultiMC_CRASH_HANDLER_EXTRA_CPP "WinBacktrace.cpp")
+ endif ()
+endif ()
+
+option(MultiMC_TEST_SEGV "Intentionally segfault sometimes to test crash handling." OFF)
+if (MultiMC_TEST_SEGV)
+ # TODO: Make this a unit test instead.
+ message(WARNING "You have enabled crash handler testing. MULTIMC WILL INTENTIONALLY CRASH ITSELF. Crashes should occur on exit and when the new instance button is pressed.")
+ add_definitions(-DTEST_SEGV)
+endif ()
+
+######## Set URLs ########
set(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from.")
@@ -250,6 +271,12 @@ SET(MULTIMC_SOURCES
BuildConfig.h
${PROJECT_BINARY_DIR}/BuildConfig.cpp
+ # Crash handling
+ HandleCrash.h
+ HandleCrash.cpp
+ ${MultiMC_CRASH_HANDLER_EXTRA_H} # Extra platform specific stuff
+ ${MultiMC_CRASH_HANDLER_EXTRA_CPP}
+
# Logging
logger/QsDebugOutput.cpp
logger/QsDebugOutput.h