diff options
| author | ruki <[email protected]> | 2024-12-14 23:03:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-14 23:03:53 +0800 |
| commit | 9efe9e3e7a7d4092cda7f4d4fa1268c8cd6fd7d6 (patch) | |
| tree | 43e985c4a478035bd93a9159866064caea5cb4dd | |
| parent | 4e7d3ddc9b5281c1be881e1a855b478bf20ef19b (diff) | |
| parent | 37a06ba56ec27223a10fcfb53a27a0644c0ce4a9 (diff) | |
Merge pull request #5967 from Doekin/zigcc-windows
Fix incorrect Zig-CC toolchain wrapper path on Windows
| -rw-r--r-- | xmake/toolchains/zig/xmake.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua index 4a92bb59d..701bf2e78 100644 --- a/xmake/toolchains/zig/xmake.lua +++ b/xmake/toolchains/zig/xmake.lua @@ -29,11 +29,12 @@ toolchain("zig") -- @see https://github.com/xmake-io/xmake/issues/5610 function _setup_zigcc_wrapper(zig) + local script_suffix = is_host("windows") and ".cmd" or "" for _, tool in ipairs({"cc", "c++", "ar", "ranlib", "objcopy"}) do - local wrapper_path = path.join(os.tmpdir(), "zigcc", tool) + local wrapper_path = path.join(os.tmpdir(), "zigcc", tool) .. script_suffix if not os.isfile(wrapper_path) then if is_host("windows") then - io.writefile(wrapper_path .. ".cmd", ("@echo off\n\"%s\" %s %%*"):format(zig, tool)) + io.writefile(wrapper_path, ("@echo off\n\"%s\" %s %%*"):format(zig, tool)) else io.writefile(wrapper_path, ("#!/bin/bash\nexec \"%s\" %s \"$@\""):format(zig, tool)) os.runv("chmod", {"+x", wrapper_path}) |
