diff options
| author | ruki <[email protected]> | 2020-07-09 22:40:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-07-09 10:02:16 +0800 |
| commit | 40610aec4087b6d86df8e633c905aa7208ea742f (patch) | |
| tree | 91bfdc9b1d8c80051f46a8aa943e62d936208ccd /xmake/toolchains/zig | |
| parent | 65563d6430e47992c78f5e53d7f771f741fe7c20 (diff) | |
improve zig toolchain
Diffstat (limited to 'xmake/toolchains/zig')
| -rw-r--r-- | xmake/toolchains/zig/xmake.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua index e46925376..cc2b927df 100644 --- a/xmake/toolchains/zig/xmake.lua +++ b/xmake/toolchains/zig/xmake.lua @@ -34,12 +34,16 @@ toolchain("zig") -- on load on_load(function (toolchain) local march - if is_plat("macosx") then - march = "x86_64-macosx-gnu" - elseif is_plat("linux") then - march = "x86_64-linux-gnu" + if toolchain:is_plat("macosx") then + march = toolchain:is_arch("x86") and "i386-macosx-gnu" or "x86_64-macosx-gnu" + elseif toolchain:is_plat("linux") then + march = toolchain:is_arch("x86") and "i386-linux-gnu" or "x86_64-linux-gnu" + elseif toolchain:is_plat("windows") then + march = toolchain:is_arch("x86") and "i386-windows-msvc" or "x86_64-windows-msvc" end if march then toolchain:add("zcflags", "-target", march) + toolchain:add("zcldflags", "-target", march) + toolchain:add("zcshflags", "-target", march) end end) |
