aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-16 10:52:45 +0100
committerGitHub Enterprise <[email protected]>2026-03-16 10:52:45 +0100
commit79e10a165cf09dc2cc120b3a226c51f87c235f20 (patch)
treecf51b07e097904044b4bf65bc3fe0ad14134074f /src/zenserver
parentLinux build improvements (#843) (diff)
downloadzen-79e10a165cf09dc2cc120b3a226c51f87c235f20.tar.xz
zen-79e10a165cf09dc2cc120b3a226c51f87c235f20.zip
Enable cross compilation of Windows targets on Linux (#839)
This PR makes it *possible* to do a Windows build on Linux via `clang-cl`. It doesn't actually change any build process. No policy change, just mechanics and some code fixes to clear clang compilation. The code fixes are mainly related to #include file name casing, to match the on-disk casing of the SDK files (via xwin).
Diffstat (limited to 'src/zenserver')
-rw-r--r--src/zenserver/storage/vfs/vfsservice.cpp2
-rw-r--r--src/zenserver/targetver.h2
-rw-r--r--src/zenserver/xmake.lua10
-rw-r--r--src/zenserver/zenserver.rc2
4 files changed, 9 insertions, 7 deletions
diff --git a/src/zenserver/storage/vfs/vfsservice.cpp b/src/zenserver/storage/vfs/vfsservice.cpp
index 863ec348a..f418c4131 100644
--- a/src/zenserver/storage/vfs/vfsservice.cpp
+++ b/src/zenserver/storage/vfs/vfsservice.cpp
@@ -62,7 +62,7 @@ GetContentAsCbObject(HttpServerRequest& HttpReq, CbObject& Cb)
// echo {"method": "mount", "params": {"path": "d:\\VFS_ROOT"}} | curl.exe http://localhost:8558/vfs --data-binary @-
// echo {"method": "unmount"} | curl.exe http://localhost:8558/vfs --data-binary @-
-VfsService::VfsService(HttpStatusService& StatusService, VfsServiceImpl* ServiceImpl) : m_StatusService(StatusService), m_Impl(ServiceImpl)
+VfsService::VfsService(HttpStatusService& StatusService, VfsServiceImpl* ServiceImpl) : m_Impl(ServiceImpl), m_StatusService(StatusService)
{
m_Router.RegisterRoute(
"info",
diff --git a/src/zenserver/targetver.h b/src/zenserver/targetver.h
index d432d6993..4805141de 100644
--- a/src/zenserver/targetver.h
+++ b/src/zenserver/targetver.h
@@ -7,4 +7,4 @@
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-#include <SDKDDKVer.h>
+#include <sdkddkver.h>
diff --git a/src/zenserver/xmake.lua b/src/zenserver/xmake.lua
index 52889fff5..6b29dadfb 100644
--- a/src/zenserver/xmake.lua
+++ b/src/zenserver/xmake.lua
@@ -60,13 +60,15 @@ target("zenserver")
end
if is_plat("windows") then
- add_ldflags("/subsystem:console,5.02")
- add_ldflags("/MANIFEST:EMBED")
- add_ldflags("/LTCG")
+ add_ldflags("/subsystem:console,5.02", {force = true})
+ add_ldflags("/MANIFEST:EMBED", {force = true})
+ if not (get_config("toolchain") or ""):find("clang") then
+ add_ldflags("/LTCG")
+ end
add_files("zenserver.rc")
add_cxxflags("/bigobj")
add_links("delayimp", "projectedfslib")
- add_ldflags("/delayload:ProjectedFSLib.dll")
+ add_ldflags("/delayload:ProjectedFSLib.dll", {force = true})
else
remove_files("windows/**")
end
diff --git a/src/zenserver/zenserver.rc b/src/zenserver/zenserver.rc
index f353bd9cc..abe1acf71 100644
--- a/src/zenserver/zenserver.rc
+++ b/src/zenserver/zenserver.rc
@@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-IDI_ICON1 ICON "..\\zen.ico"
+IDI_ICON1 ICON "../zen.ico"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////