diff options
| author | Per Larsson <[email protected]> | 2021-09-07 10:26:22 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-09-07 10:26:22 +0200 |
| commit | c5dd3d32cb29ac963f61eb6c119d54ed14f94f9a (patch) | |
| tree | 57a04246635577f11a35bb9a670610d508e694e8 /zenserver/zenserver.cpp | |
| parent | Added custom cpr::Response formatter and removed duplicate logging code. (diff) | |
| parent | Clarified some async/sync behaviour in HTTP implementation (diff) | |
| download | zen-c5dd3d32cb29ac963f61eb6c119d54ed14f94f9a.tar.xz zen-c5dd3d32cb29ac963f61eb6c119d54ed14f94f9a.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index e465734e0..c857d4c71 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -40,12 +40,26 @@ #include "config.h" #include "diag/logging.h" -#define SENTRY_BUILD_STATIC 1 -#include <sentry.h> -#pragma comment(lib, "sentry.lib") -#pragma comment(lib, "dbghelp.lib") -#pragma comment(lib, "winhttp.lib") -#pragma comment(lib, "version.lib") +////////////////////////////////////////////////////////////////////////// +// Sentry +// + +#define USE_SENTRY 1 + +#if USE_SENTRY +# define SENTRY_BUILD_STATIC 1 +# include <sentry.h> + +// Sentry currently does not automatically add all required Windows +// libraries to the linker when consumed via vcpkg + +# if ZEN_PLATFORM_WINDOWS +# pragma comment(lib, "sentry.lib") +# pragma comment(lib, "dbghelp.lib") +# pragma comment(lib, "winhttp.lib") +# pragma comment(lib, "version.lib") +# endif +#endif ////////////////////////////////////////////////////////////////////////// // Services @@ -261,7 +275,9 @@ public: spdlog::info(ZEN_APP_NAME " now running"); +#if USE_SENTRY sentry_clear_modulecache(); +#endif if (m_DebugOptionForcedCrash) { @@ -373,6 +389,7 @@ main(int argc, char* argv[]) ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig); InitializeLogging(GlobalOptions); +#if USE_SENTRY // Initialize sentry.io client sentry_options_t* SentryOptions = sentry_options_new(); @@ -380,6 +397,7 @@ main(int argc, char* argv[]) sentry_init(SentryOptions); auto _ = zen::MakeGuard([&] { sentry_close(); }); +#endif // Prototype config system, let's see how this pans out |