diff options
| author | Saikari <[email protected]> | 2026-01-27 08:42:39 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-27 08:42:39 +0300 |
| commit | deb92145cccffb075de344c3f4fd997936b4a265 (patch) | |
| tree | 06815d12509c5c09025ea7d763bb2d13768603e0 /xmake/toolchains/zig/xmake.lua | |
| parent | 8dcdca8ffafd766cb19e740a99876230264f63b8 (diff) | |
enhance target architecture handling for cross-compilation in zig toolchain
Diffstat (limited to 'xmake/toolchains/zig/xmake.lua')
| -rw-r--r-- | xmake/toolchains/zig/xmake.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua index 98c4e256a..c8c23408e 100644 --- a/xmake/toolchains/zig/xmake.lua +++ b/xmake/toolchains/zig/xmake.lua @@ -137,7 +137,20 @@ toolchain("zig") local target = toolchain:cross() if target then - local tarch = target:match("^(.-)-") or target + local tarch = target:split("%-")[1] or target + + if arch == "i686" then + arch = "i386" + elseif arch == "aarch64" then + arch = "arm64" + end + + if tarch == "i686" then + tarch = "i386" + elseif tarch == "aarch64" then + tarch = "arm64" + end + if arch ~= tarch then target = nil end |
