Update crashpad

crashpad is now also supported on Linux. Therefore build it everywhere except under Windows MinGW.
This commit is contained in:
Roland Rossgotterer
2018-12-12 11:51:48 +01:00
committed by Klaus Basan
parent 59343c6c24
commit 686f8a478e
4 changed files with 16 additions and 9 deletions

View File

@@ -1604,6 +1604,7 @@ namespace BlackCore
}
#ifdef BLACK_USE_CRASHPAD
//! Convert to file path
base::FilePath qstringToFilePath(const QString &str)
{
# ifdef Q_OS_WIN
@@ -1641,11 +1642,16 @@ namespace BlackCore
QDir().mkpath(database);
m_crashReportDatabase = CrashReportDatabase::Initialize(qstringToFilePath(database));
auto settings = m_crashReportDatabase->GetSettings();
crashpad::Settings *settings = m_crashReportDatabase->GetSettings();
settings->SetUploadsEnabled(CBuildConfig::isReleaseBuild() && m_crashDumpSettings.getThreadLocal().isEnabled());
m_crashpadClient = std::make_unique<CrashpadClient>();
m_crashpadClient->StartHandler(qstringToFilePath(handler), qstringToFilePath(database), qstringToFilePath(metrics),
serverUrl.getFullUrl().toStdString(), annotations, {}, false, true);
m_crashpadClient->StartHandler(qstringToFilePath(handler),
qstringToFilePath(database),
qstringToFilePath(metrics),
serverUrl.getFullUrl().toStdString(),
annotations,
{},
false, true);
return CStatusMessage(this).info("Using crash handler");
#else
return CStatusMessage(this).info("Not using crash handler");

View File

@@ -43,7 +43,7 @@
#include <atomic>
#include <functional>
#if defined(Q_CC_MSVC) || defined(Q_OS_MACOS) // Crashpad only supported on MSVC and MacOS/X
#if !defined(Q_CC_MINGW)
#define BLACK_USE_CRASHPAD
#endif

View File

@@ -20,7 +20,7 @@ PRECOMPILED_HEADER = pch/pch.h
DEFINES += LOG_IN_FILE BUILD_BLACKCORE_LIB
INCLUDEPATH *= $$EXTERNALSROOT/common/include/crashpad
INCLUDEPATH *= $$EXTERNALSROOT/common/include/mini_chromium
INCLUDEPATH *= $$EXTERNALSROOT/common/include/crashpad/mini_chromium
HEADERS += *.h
HEADERS += $$PWD/application/*.h
@@ -41,10 +41,11 @@ DESTDIR = $$DestRoot/lib
DLLDESTDIR = $$DestRoot/bin
msvc {
CONFIG(debug, debug|release): LIBS *= -lcrashpad_clientd -lcrashpad_utild -lbased -lRpcrt4 -lAdvapi32
CONFIG(release, debug|release): LIBS *= -lcrashpad_client -lcrashpad_util -lbase -lRpcrt4 -lAdvapi32
CONFIG(debug, debug|release): LIBS *= -lclientd -lutild -lbased -lRpcrt4 -lAdvapi32
CONFIG(release, debug|release): LIBS *= -lclient -lutil -lbase -lRpcrt4 -lAdvapi32
}
macx: LIBS *= -lcrashpad_client -lcrashpad_util -lbase -lbsm -framework Security
macx: LIBS *= -lclient -lutil -lbase -lbsm -framework Security
unix:!macx: LIBS *= -lclient -lutil -lbase
OTHER_FILES += readme.txt *.xml