diff options
| -rw-r--r-- | xmake/modules/core/tools/zig.lua | 8 | ||||
| -rw-r--r-- | xmake/toolchains/zig/xmake.lua | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/zig.lua b/xmake/modules/core/tools/zig.lua index 23f0d6e32..81d06c0da 100644 --- a/xmake/modules/core/tools/zig.lua +++ b/xmake/modules/core/tools/zig.lua @@ -106,14 +106,6 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags) local argv = {} if targetkind == "binary" then table.insert(argv, "build-exe") - if is_plat("windows") then - -- TODO this is only a temporary workaround to fix msvc/lld issue for zig 0.7.0. - -- @see https://github.com/ziglang/zig/issues/5825 - table.insert(argv, "--subsystem") - table.insert(argv, "console") - table.insert(argv, "-lkernel32") - table.insert(argv, "-lntdll") - end elseif targetkind == "static" or targetkind == "shared" then table.insert(argv, "build-lib") else diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua index 0ba11436f..5125a106a 100644 --- a/xmake/toolchains/zig/xmake.lua +++ b/xmake/toolchains/zig/xmake.lua @@ -50,4 +50,10 @@ toolchain("zig") toolchain:add("zcldflags", "-target", march) toolchain:add("zcshflags", "-target", march) end + + -- @see https://github.com/ziglang/zig/issues/5825 + if toolchain:is_plat("windows") then + toolchain:add("zcldflags", "--subsystem console") + toolchain:add("syslinks", "kernel32", "ntdll") + end end) |
