Skip to content

Commit 9efe9e3

Browse files
authored
Merge pull request #5967 from Doekin/zigcc-windows
Fix incorrect Zig-CC toolchain wrapper path on Windows
2 parents 4e7d3dd + 37a06ba commit 9efe9e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xmake/toolchains/zig/xmake.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ toolchain("zig")
2929

3030
-- @see https://github.com/xmake-io/xmake/issues/5610
3131
function _setup_zigcc_wrapper(zig)
32+
local script_suffix = is_host("windows") and ".cmd" or ""
3233
for _, tool in ipairs({"cc", "c++", "ar", "ranlib", "objcopy"}) do
33-
local wrapper_path = path.join(os.tmpdir(), "zigcc", tool)
34+
local wrapper_path = path.join(os.tmpdir(), "zigcc", tool) .. script_suffix
3435
if not os.isfile(wrapper_path) then
3536
if is_host("windows") then
36-
io.writefile(wrapper_path .. ".cmd", ("@echo off\n\"%s\" %s %%*"):format(zig, tool))
37+
io.writefile(wrapper_path, ("@echo off\n\"%s\" %s %%*"):format(zig, tool))
3738
else
3839
io.writefile(wrapper_path, ("#!/bin/bash\nexec \"%s\" %s \"$@\""):format(zig, tool))
3940
os.runv("chmod", {"+x", wrapper_path})

0 commit comments

Comments
 (0)