summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-05 10:26:44 +0800
committerGitHub <[email protected]>2024-11-05 10:26:44 +0800
commita71785c9a6d7c7a3ca953986e155e50015c06214 (patch)
tree44320c10e8d6d1482033677ae4d6d5ff7bcecc9c
parenteada026c1e27728861f76449b77726b3ebe8bff0 (diff)
parent4392754edda6b619e70a0b225598f3a25f8938c4 (diff)
Merge pull request #5787 from wenxuanjun/zig-compile-as
allow using zig cc to compile assembly
-rw-r--r--xmake/toolchains/zig/xmake.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua
index fc24290b9..adff1be42 100644
--- a/xmake/toolchains/zig/xmake.lua
+++ b/xmake/toolchains/zig/xmake.lua
@@ -59,6 +59,7 @@ toolchain("zig")
if toolchain:config("zigcc") ~= false then
-- we can use `set_toolchains("zig", {zigcc = false})` to disable zigcc
-- @see https://github.com/xmake-io/xmake/issues/3251
+ toolchain:set("toolset", "as", zig .. " cc")
toolchain:set("toolset", "cc", zig .. " cc")
toolchain:set("toolset", "cxx", zig .. " c++")
toolchain:set("toolset", "ld", zig .. " c++")
@@ -119,6 +120,7 @@ toolchain("zig")
target = arch .. "-windows-gnu"
end
if target then
+ toolchain:add("zig_cc.asflags", "-target", target)
toolchain:add("zig_cc.cxflags", "-target", target)
toolchain:add("zig_cc.shflags", "-target", target)
toolchain:add("zig_cc.ldflags", "-target", target)