1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00

Change sentry to be windows only for now

this still has general problems with osx builds and m1 support
This commit is contained in:
Elias Steurer 2022-04-24 09:01:59 +02:00
parent 5c138fa8d4
commit 86aaa7147e
5 changed files with 20 additions and 5 deletions

View File

@ -115,9 +115,12 @@ set(TS_FILES
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
# CURL must be included before sentry because sentry needs the module and does not include it itself on macos...
find_package(CURL CONFIG REQUIRED)
find_package(sentry CONFIG REQUIRED)
# Make sentry win only for now because it is constantly buggy on osx
if(WIN32)
# CURL must be included before sentry because sentry needs the module and does not include it itself on macos...
find_package(CURL CONFIG REQUIRED)
find_package(sentry CONFIG REQUIRED)
endif()
find_package(
Qt6
@ -148,7 +151,6 @@ target_include_directories(
target_link_libraries(
ScreenPlayLib
PUBLIC ScreenPlaySDK
sentry::sentry
Threads::Threads
Qt6::Quick
Qt6::Gui
@ -214,6 +216,8 @@ qt_add_qml_module(
${QML})
if(WIN32)
target_link_libraries(${PROJECT_NAME} PUBLIC sentry::sentry)
# Icon
target_sources(${PROJECT_NAME} PRIVATE ScreenPlay.rc)

View File

@ -36,13 +36,17 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
#if defined(Q_OS_WIN)
#include <sentry.h>
#endif
Q_IMPORT_QML_PLUGIN(ScreenPlayQmlPlugin)
Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin)
#ifdef SCREENPLAY_STEAM
Q_IMPORT_QML_PLUGIN(ScreenPlayWorkshopPlugin)
#endif
int main(int argc, char* argv[])
{
Q_INIT_RESOURCE(Resources);
@ -56,7 +60,9 @@ int main(int argc, char* argv[])
} else {
app.init();
const int status = qtGuiApp.exec();
#if defined(Q_OS_WIN)
sentry_shutdown();
#endif
return status;
}
}

View File

@ -168,6 +168,7 @@ void App::init()
// Only create anonymousTelemetry if user did not disallow!
if (m_settings->anonymousTelemetry()) {
#if defined(Q_OS_WIN)
sentry_options_t* options = sentry_options_new();
sentry_options_set_dsn(options, "https://425ea0b77def4f91a5a9decc01b36ff4@o428218.ingest.sentry.io/5373419");
@ -183,6 +184,7 @@ void App::init()
if (sentryInitStatus != 0) {
qWarning() << "Unable to inti sentry crashhandler with statuscode: " << sentryInitStatus;
}
#endif
}
m_create = make_unique<Create>(m_globalVariables);

View File

@ -221,6 +221,7 @@ void Util::logToGui(QtMsgType type, const QMessageLogContext& context, const QSt
if (utilPointer != nullptr)
utilPointer->appendDebugMessages(log);
#if defined(Q_OS_WIN)
sentry_value_t crumb
= sentry_value_new_breadcrumb("default", qUtf8Printable(msg));
@ -238,6 +239,7 @@ void Util::logToGui(QtMsgType type, const QMessageLogContext& context, const QSt
sentry_value_set_by_key(crumb, "data", location);
sentry_add_breadcrumb(crumb);
#endif
}
/*!

View File

@ -12,7 +12,6 @@ vcpkg_version = "2ac61f8" # Master 23.04.2022
vcpkg_packages_list = [
"openssl",
"curl",
"sentry-native",
"cpp-httplib"
]
@ -75,9 +74,11 @@ without the ScreenPlay-vcpkg folder (E.g. py .\setup.py --path "D:/Backup/Code/Q
vcpkg_command = ""
platform_command = commands_list()
if system() == "Windows":
vcpkg_command = "vcpkg.exe"
vcpkg_packages_list.append("infoware[d3d]")
vcpkg_packages_list.append("sentry-native")
if shutil.which("pwsh"):
print("Using experimental pwsh, may not work properly.")
platform_command.add("pwsh.exe -NoProfile -ExecutionPolicy Bypass .\scripts\\bootstrap.ps1", vcpkg_path)