diff options
| author | ruki <[email protected]> | 2020-12-12 17:20:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-12 17:20:36 +0800 |
| commit | a19599daf975eed4d31e0815aeaf3a326acf58f8 (patch) | |
| tree | 4456edb8b8668f968c54f46e17adbda3641a20b3 | |
| parent | 3b00d2ead350fcc5e26f40878d5e1e342adfc67a (diff) | |
set subsystem to zig
| -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) |
