Skip to content

Commit

Permalink
feat: improved check wrt macos & sentry enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulmathur001 committed Apr 17, 2024
1 parent d346c0c commit a95150f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-mudlet.yml
Expand Up @@ -49,7 +49,6 @@ jobs:
env:
BOOST_ROOT: ${{github.workspace}}/3rdparty/boost
BOOST_URL: https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2/download
WITH_SENTRY: NO
SENTRY_ORG: mehul-mathur
SENTRY_PROJECT: native-qt-mac
SENTRY_AUTH_TOKEN: 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
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Expand Up @@ -270,9 +270,6 @@ if(APPLE AND USE_SENTRY)
set(SENTRY_INTEGRATION_QT "ON")
set(SENTRY_INCLUDE_DIR "3rdparty/sentry-native/include")
set(SENTRY_LIBRARIES "3rdparty/sentry-native")
endif()

if(APPLE AND USE_SENTRY)
add_subdirectory(3rdparty/sentry-native)
endif()

Expand Down
18 changes: 9 additions & 9 deletions src/main.cpp
Expand Up @@ -175,15 +175,15 @@ void initSentry() {

sentry_set_tag("mudlet-version", APP_VERSION);

/*
sentry_capture_event(sentry_value_new_message_event(
SENTRY_LEVEL_INFO,
"Testing",
"Working as expected!"
));
*/

throw std::runtime_error("This is a test runtime error!");

sentry_capture_event(sentry_value_new_message_event(
SENTRY_LEVEL_INFO,
"Testing",
"Working as expected!"
));

Check notice on line 183 in src/main.cpp

View check run for this annotation

codefactor.io / CodeFactor

src/main.cpp#L183

Closing ) should be moved to the previous line (whitespace/parens)


// throw std::runtime_error("This is a test runtime error!");
#endif
}

Expand Down
30 changes: 23 additions & 7 deletions src/mudlet.pro
Expand Up @@ -243,9 +243,11 @@ isEmpty( 3DMAPPER_TEST ) | !equals(3DMAPPER_TEST, "NO" ) {
# To remove the sentry, set the environment WITH_SENTRY variable to "NO"
# ie: export WITH_SENTRY="NO" qmake
#
SENTRY_TEST = $$upper($$(WITH_SENTRY))
isEmpty( SENTRY_TEST ) | !equals(SENTRY_TEST, "NO" ) {
DEFINES += INCLUDE_SENTRY
macx {
SENTRY_TEST = $$upper($$(WITH_SENTRY))
isEmpty( SENTRY_TEST ) | !equals(SENTRY_TEST, "NO" ) {
DEFINES += INCLUDE_SENTRY
}
}

######################## System QtKeyChain library #############################
Expand Down Expand Up @@ -466,7 +468,9 @@ macx:LIBS += -lz
INCLUDEPATH += ../3rdparty/discord/rpc/include

macx {
INCLUDEPATH += ../3rdparty/sentry-native/include
contains( DEFINES, INCLUDE_SENTRY ) {
INCLUDEPATH += ../3rdparty/sentry-native/include
}
}

# Define a preprocessor symbol with the default fallback location from which
Expand Down Expand Up @@ -521,7 +525,12 @@ win32 {
}
} else {
macx {
system("cd $${PWD}/.. ; git submodule update --init --recursive 3rdparty/sentry-native")
contains( DEFINES, INCLUDE_SENTRY ) {
!exists("$${PWD}/../3rdparty/sentry-native/sentry-config.cmake.in") {
message("git submodule for required sentry-native missing from source code, executing 'git submodule update --init --recursive' to get it...")
system("cd $${PWD}/.. ; git submodule update --init --recursive 3rdparty/sentry-native")
}
}
}
!exists("$${PWD}/../3rdparty/edbee-lib/edbee-lib/edbee-lib.pri") {
message("git submodule for required edbee-lib editor widget missing from source code, executing 'git submodule update --init' to get it...")
Expand Down Expand Up @@ -860,9 +869,16 @@ HEADERS += \
widechar_width.h \
../3rdparty/discord/rpc/include/discord_register.h \
../3rdparty/discord/rpc/include/discord_rpc.h

macx {
HEADERS += ../3rdparty/sentry-native/include/sentry.h
contains( DEFINES, INCLUDE_SENTRY ) {
# sentry-native is needed for MacOS builds with crash-reporting
exists("$${PWD}/../3rdparty/sentry-native/sentry-config.cmake.in") {
HEADERS += ../3rdparty/sentry-native/include/sentry.h
} else {
error("Cannot locate sentry-native submodule source code, build abandoned!")
}
}
}

macx|win32 {
Expand Down

0 comments on commit a95150f

Please sign in to comment.