aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-07 09:57:54 +0200
committerStefan Boberg <[email protected]>2021-09-07 09:57:54 +0200
commitb3989147a3aef89401115e49000df82787196e63 (patch)
tree047af036999b19ff6eb9bfc635a3b3498b783081 /zenserver/zenserver.cpp
parentMerge branch 'main' of https://github.com/EpicGames/zen (diff)
downloadzen-b3989147a3aef89401115e49000df82787196e63.tar.xz
zen-b3989147a3aef89401115e49000df82787196e63.zip
Cleaned up sentry integration somewhat, to make it easier to enable/disable and separated out the Windows specific configuraiton
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp30
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