From 3abde8d88bde436dce423eae9edee0f4e8af915a Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 13 Mar 2026 17:06:39 +0100 Subject: Add clang-cl build support - Add clang-cl warning suppressions in xmake.lua matching Linux/macOS set - Guard /experimental:c11atomics with {tools="cl"} for MSVC-only - Fix long long / int64_t redefinition in string.h for clang-cl - Fix unclosed namespace in callstacktrace.cpp #else branch - Fix missing override in httpplugin.cpp - Reorder WorkerPool fields to match designated initializer order - Use INVALID_SOCKET instead of SOCKET_ERROR for SOCKET comparisons --- xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index 94343cc90..6e7b22b1d 100644 --- a/xmake.lua +++ b/xmake.lua @@ -189,6 +189,30 @@ if is_os("linux") or is_os("macosx") then add_cxxflags("-Wno-vla-cxx-extension") end +if get_config("toolchain") == "clang-cl" then + add_cxxflags("-Wno-unknown-warning-option", {force=true}) + add_cxxflags("-Wno-cast-function-type-mismatch", {force=true}) + add_cxxflags("-Wno-delete-non-abstract-non-virtual-dtor", {force=true}) + add_cxxflags("-Wno-format", {force=true}) + add_cxxflags("-Wno-implicit-fallthrough", {force=true}) + add_cxxflags("-Wno-inconsistent-missing-override", {force=true}) + add_cxxflags("-Wno-missing-field-initializers", {force=true}) + add_cxxflags("-Wno-parentheses-equality", {force=true}) + add_cxxflags("-Wno-reorder-ctor", {force=true}) + add_cxxflags("-Wno-sign-compare", {force=true}) + add_cxxflags("-Wno-strict-aliasing", {force=true}) + add_cxxflags("-Wno-switch", {force=true}) + add_cxxflags("-Wno-unused-but-set-variable", {force=true}) + add_cxxflags("-Wno-unused-lambda-capture", {force=true}) + add_cxxflags("-Wno-unused-parameter", {force=true}) + add_cxxflags("-Wno-unused-private-field", {force=true}) + add_cxxflags("-Wno-unused-value", {force=true}) + add_cxxflags("-Wno-unused-variable", {force=true}) + add_cxxflags("-Wno-vla-cxx-extension", {force=true}) + add_cflags("-Wno-unknown-warning-option", {force=true}) + add_cflags("-Wno-unused-command-line-argument", {force=true}) +end + if is_os("macosx") then -- silence warnings about -Wno-vla-cxx-extension since to my knowledge we can't -- detect the clang version used in Xcode and only recent versions contain this flag -- cgit v1.2.3 From 162d7412405e78198ede361a8fbae8dc8b82278a Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 13 Mar 2026 22:30:32 +0100 Subject: Made CPR optional, html generated at build time (#840) - Fix potential crash on startup caused by logging macros being invoked before the logging system is initialized (null logger dereference in `ZenServerState::Sweep()`). `LoggerRef::ShouldLog` now guards against a null logger pointer. - Make CPR an optional dependency (`--zencpr` build option, enabled by default) so builds can proceed without it - Make zenvfs Windows-only (platform-specific target) - Generate the frontend zip at build time from source HTML files instead of checking in a binary blob which would accumulate with every single update --- xmake.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index 6e7b22b1d..561f9f399 100644 --- a/xmake.lua +++ b/xmake.lua @@ -310,6 +310,13 @@ option("zentrace") option_end() add_define_by_config("ZEN_WITH_TRACE", "zentrace") +option("zencpr") + set_default(true) + set_showmenu(true) + set_description("Enable CPR HTTP client backend") +option_end() +add_define_by_config("ZEN_WITH_CPR", "zencpr") + set_warnings("allextra", "error") set_languages("cxx20") @@ -352,7 +359,9 @@ end includes("src/zenstore", "src/zenstore-test") includes("src/zentelemetry", "src/zentelemetry-test") includes("src/zenutil", "src/zenutil-test") -includes("src/zenvfs") +if is_plat("windows") then + includes("src/zenvfs") +end includes("src/zenserver", "src/zenserver-test") includes("src/zen") includes("src/zentest-appstub") @@ -390,16 +399,6 @@ task("kill") end end) -task("updatefrontend") - set_menu { - usage = "xmake updatefrontend", - description = "Create Zip of the frontend/html folder for bundling with zenserver executable", - } - on_run(function() - import("scripts.updatefrontend") - updatefrontend() - end) - task("precommit") set_menu { usage = "xmake precommit", -- cgit v1.2.3