summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorForkk <forkk@forkk.net>2014-05-09 17:33:32 -0500
committerForkk <forkk@forkk.net>2014-05-09 17:33:32 -0500
commit93ae21abfcce1c6b36e5cd68d23045f2b9ac438d (patch)
treeb89d027023688d5d9e9665160d74188c9ae4c39c /CMakeLists.txt
parentcf616efb5da6240db80a810f96abd8e8325ff3c9 (diff)
downloadMultiMC-93ae21abfcce1c6b36e5cd68d23045f2b9ac438d.tar
MultiMC-93ae21abfcce1c6b36e5cd68d23045f2b9ac438d.tar.gz
MultiMC-93ae21abfcce1c6b36e5cd68d23045f2b9ac438d.tar.lz
MultiMC-93ae21abfcce1c6b36e5cd68d23045f2b9ac438d.tar.xz
MultiMC-93ae21abfcce1c6b36e5cd68d23045f2b9ac438d.zip
Implement crash handling on Linux
This will allow us to generate crash dumps and have users report crashes.
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 85ac4b57..86881241 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,8 +75,31 @@ 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 (UNIX)
+ set(CRASH_HANDLER_IMPL "UnixCrash.cpp")
+ elseif (WIN32)
+ message(WARNING "The crash dump system is not currently implemented on Windows")
+ #set(CRASH_HANDLER_IMPL "WinCrash.cpp")
+ else ()
+ message(WARNING "The crash dump system is not supported on this platform.")
+ endif ()
+endif ()
+
+option(MultiMC_TEST_SEGV "Intentionally segfault on startup 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 ON STARTUP.")
+ 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 +273,10 @@ SET(MULTIMC_SOURCES
BuildConfig.h
${PROJECT_BINARY_DIR}/BuildConfig.cpp
+ # Crash handling
+ HandleCrash.h
+ ${CRASH_HANDLER_IMPL}
+
# Logging
logger/QsDebugOutput.cpp
logger/QsDebugOutput.h