1
0
Fork 0

Modified Cmake and bootstrap to porperly support exclusion of Sentry.io

This commit is contained in:
SDeAstis 2021-11-16 15:46:57 +01:00 committed by James Turner
parent aad67cdad9
commit 493a9fa60d
2 changed files with 12 additions and 5 deletions

View file

@ -195,7 +195,7 @@ option(ENABLE_DEMCONVERT "Set to ON to build the dem conversion tool (default)"
option(ENABLE_HID_INPUT "Set to ON to build HID-based input code" ${EVENT_INPUT_DEFAULT})
option(ENABLE_PLIB_JOYSTICK "Set to ON to enable legacy joystick code (default)" ON)
option(ENABLE_SWIFT "Set to ON to build the swift module" ON)
option(ENABLE_SENTRY "Set to ON to build the Sentry.io crash reporting" ON)
# Test-suite options.
option(ENABLE_AUTOTESTING "Set to ON to execute the test suite after building the test_suite target (default)" ON)
@ -275,6 +275,9 @@ find_package(OpenSceneGraph 3.6.0 REQUIRED
osgGA
)
##############################################################################
## Sentry.io setup
if (ENABLE_SENTRY)
find_package(sentry QUIET)
set(sentry_api_key "https://b10d9504e71244a7a86ba6c93acf6412@o372956.ingest.sentry.io/5188535")
@ -282,6 +285,7 @@ if (TARGET sentry::sentry)
message(STATUS "Sentry.io crash reporting enabled")
set(HAVE_SENTRY 1)
endif()
endif (ENABLE_SENTRY)
##############################################################################
## Sqlite3 setup

View file

@ -268,10 +268,13 @@ int main ( int argc, char **argv )
_bootstrap_OSInit = 0;
#if defined(HAVE_SENTRY)
const bool noSentry = flightgear::Options::checkForArg(argc, argv, "disable-sentry");
if (!noSentry) {
std::cerr << "Will init sentry" << std::endl;
flightgear::initSentry();
std::cerr << "Did init sentry" << std::endl;
#endif
}
#endif
// if we're not using the normal crash-reported, install our
// custom segfault handler on Linux, in debug builds.