aboutsummaryrefslogtreecommitdiff
path: root/zenserver
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
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')
-rw-r--r--zenserver/vfs.cpp26
-rw-r--r--zenserver/vfs.h2
-rw-r--r--zenserver/xmake.lua9
-rw-r--r--zenserver/zenserver.cpp30
4 files changed, 48 insertions, 19 deletions
diff --git a/zenserver/vfs.cpp b/zenserver/vfs.cpp
index 71f0bbdda..5b6a3e4b6 100644
--- a/zenserver/vfs.cpp
+++ b/zenserver/vfs.cpp
@@ -2,19 +2,20 @@
#include "vfs.h"
-#include <zencore/except.h>
-#include <zencore/filesystem.h>
-#include <zencore/snapshot_manifest.h>
-#include <zencore/stream.h>
-#include <zencore/windows.h>
+#if WITH_VFS
+# include <zencore/except.h>
+# include <zencore/filesystem.h>
+# include <zencore/snapshot_manifest.h>
+# include <zencore/stream.h>
+# include <zencore/windows.h>
-#include <map>
+# include <map>
-#include <atlfile.h>
-#include <projectedfslib.h>
-#include <spdlog/spdlog.h>
+# include <atlfile.h>
+# include <projectedfslib.h>
+# include <spdlog/spdlog.h>
-#pragma comment(lib, "projectedfslib.lib")
+# pragma comment(lib, "projectedfslib.lib")
namespace zen {
@@ -472,9 +473,9 @@ ProjfsProvider::DebugPrint(const char* FmtString, ...)
va_list vl;
va_start(vl, FmtString);
-#if 0
+# if 0
vprintf(FmtString, vl);
-#endif
+# endif
va_end(vl);
}
@@ -896,3 +897,4 @@ Vfs::Stop()
}
} // namespace zen
+#endif \ No newline at end of file
diff --git a/zenserver/vfs.h b/zenserver/vfs.h
index e77ff381b..4b7c5e30a 100644
--- a/zenserver/vfs.h
+++ b/zenserver/vfs.h
@@ -2,6 +2,7 @@
#pragma once
+#if WITH_VFS
#include <zencore/httpserver.h>
#include <zenstore/CAS.h>
@@ -29,3 +30,4 @@ private:
};
} // namespace zen
+#endif
diff --git a/zenserver/xmake.lua b/zenserver/xmake.lua
index 5c994a3a7..8319dedec 100644
--- a/zenserver/xmake.lua
+++ b/zenserver/xmake.lua
@@ -15,4 +15,11 @@ target("zenserver")
add_ldflags("/MANIFESTUAC:level='requireAdministrator'")
add_ldflags("/LTCG")
end
- \ No newline at end of file
+
+ add_packages(
+ "vcpkg::sentry-native",
+ "vcpkg::sol2",
+ "vcpkg::lua",
+ "vcpkg::asio",
+ "vcpkg::json11"
+ ) \ No newline at end of file
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