diff options
| author | Stefan Boberg <[email protected]> | 2026-03-15 22:53:37 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-03-15 22:53:37 +0100 |
| commit | da216166aab918bc93ee73040c1eb6336ea6d026 (patch) | |
| tree | 87263e1e70d975c640981a50474290cdad1382cc /src/zenserver | |
| parent | Change --noclean to --clean in toolchain verify script (diff) | |
| parent | Merge branch 'main' into sb/linux-build-improvements (diff) | |
| download | zen-sb/linux-build-improvements.tar.xz zen-sb/linux-build-improvements.zip | |
Merge branch 'sb/linux-build-improvements' of ssh://arn-wd-l1704.localdomain:2222/ue-foundation/zen into sb/linux-build-improvementssb/linux-build-improvements
Diffstat (limited to 'src/zenserver')
| -rw-r--r-- | src/zenserver/frontend/html.zip | bin | 431365 -> 0 bytes | |||
| -rw-r--r-- | src/zenserver/xmake.lua | 48 |
2 files changed, 44 insertions, 4 deletions
diff --git a/src/zenserver/frontend/html.zip b/src/zenserver/frontend/html.zip Binary files differdeleted file mode 100644 index 58778a592..000000000 --- a/src/zenserver/frontend/html.zip +++ /dev/null diff --git a/src/zenserver/xmake.lua b/src/zenserver/xmake.lua index 3cfaa956d..52889fff5 100644 --- a/src/zenserver/xmake.lua +++ b/src/zenserver/xmake.lua @@ -12,12 +12,14 @@ target("zenserver") "zenremotestore", "zenstore", "zentelemetry", - "zenutil", - "zenvfs") + "zenutil") + if is_plat("windows") then + add_deps("zenvfs") + end add_headerfiles("**.h") add_rules("utils.bin2c", {extensions = {".zip"}}) add_files("**.cpp") - add_files("frontend/*.zip") + add_files("frontend/html.zip") add_files("zenserver.cpp", {unity_ignored = true }) if is_plat("linux") and not (get_config("toolchain") or ""):find("clang") then @@ -78,7 +80,45 @@ target("zenserver") add_ldflags("-framework SystemConfiguration") end - -- to work around some unfortunate Ctrl-C behaviour on Linux/Mac due to + on_load(function(target) + local html_dir = path.join(os.projectdir(), "src/zenserver/frontend/html") + local zip_path = path.join(os.projectdir(), "src/zenserver/frontend/html.zip") + + -- Check if zip needs regeneration + local need_update = not os.isfile(zip_path) + if not need_update then + local zip_mtime = os.mtime(zip_path) + for _, file in ipairs(os.files(path.join(html_dir, "**"))) do + if os.mtime(file) > zip_mtime then + need_update = true + break + end + end + end + + if need_update then + print("Regenerating frontend zip...") + os.tryrm(zip_path) + + import("detect.tools.find_7z") + local cmd_7z = find_7z() + if cmd_7z then + os.execv(cmd_7z, {"a", "-mx0", zip_path, path.join(html_dir, ".")}) + else + import("detect.tools.find_zip") + local zip_cmd = find_zip() + if zip_cmd then + local oldir = os.cd(html_dir) + os.execv(zip_cmd, {"-r", "-0", zip_path, "."}) + os.cd(oldir) + else + raise("Unable to find a suitable zip tool (need 7z or zip)") + end + end + end + end) + + -- to work around some unfortunate Ctrl-C behaviour on Linux/Mac due to -- our use of setsid() at startup we pass in `--no-detach` to zenserver -- ensure that it recieves signals when the user requests termination on_run(function(target) |