aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-07 10:26:22 +0200
committerPer Larsson <[email protected]>2021-09-07 10:26:22 +0200
commitc5dd3d32cb29ac963f61eb6c119d54ed14f94f9a (patch)
tree57a04246635577f11a35bb9a670610d508e694e8 /zenserver/zenserver.cpp
parentAdded custom cpr::Response formatter and removed duplicate logging code. (diff)
parentClarified some async/sync behaviour in HTTP implementation (diff)
downloadzen-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.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