From b492db92027dfdbb073f430d04e929ab826116fb Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 11 Nov 2020 22:33:53 +0800 Subject: add temp workaround to fix zig lld on windows --- xmake/modules/core/tools/zig.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmake/modules/core/tools/zig.lua b/xmake/modules/core/tools/zig.lua index 81d06c0da..23f0d6e32 100644 --- a/xmake/modules/core/tools/zig.lua +++ b/xmake/modules/core/tools/zig.lua @@ -106,6 +106,14 @@ 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 -- cgit v1.3.1