summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2025-05-13 11:13:07 +0200
committerGitHub <[email protected]>2025-05-13 11:13:07 +0200
commitcee0474d82ff8d524c6a8265b81ace41225b820f (patch)
treeb3e94b5471aecb9a20947d19e9e77f735d3f0526
parent9b1b539d087eff3e7b62ec700839e2beb7842ebc (diff)
target_triple: allow to pass system/abi to cross
-rw-r--r--xmake/modules/core/tools/rustc/target_triple.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/rustc/target_triple.lua b/xmake/modules/core/tools/rustc/target_triple.lua
index ddbf052ea..6064b041c 100644
--- a/xmake/modules/core/tools/rustc/target_triple.lua
+++ b/xmake/modules/core/tools/rustc/target_triple.lua
@@ -47,8 +47,12 @@ function _translate_plat(plat, arch, opt)
return "-pc-windows-msvc"
elseif plat == "mingw" or plat == "msys" then
return "-pc-windows-gnu"
- elseif plat == "linux" or plat == "cross" then
+ elseif plat == "linux" then
return "-unknown-linux-gnu"
+ elseif plat == "cross" then
+ local system = opt and opt.system or "-unknown-linux"
+ local abi = opt and opt.abi or "-gnu"
+ return system .. abi
elseif plat == "macosx" then
return "-apple-darwin"
elseif plat == "android" then