summaryrefslogtreecommitdiff
path: root/xmake/toolchains/rust/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-11 22:23:08 +0800
committerruki <[email protected]>2023-11-11 22:23:08 +0800
commite6504c8d0a4d42d2a57b68f9d25a0cbbb2c8289e (patch)
treee83b35429d67134df6d00743b71dc74437ca6bb0 /xmake/toolchains/rust/xmake.lua
parentf205de61c97bad8457838272b33c37d876063851 (diff)
fix target for rust
Diffstat (limited to 'xmake/toolchains/rust/xmake.lua')
-rw-r--r--xmake/toolchains/rust/xmake.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/toolchains/rust/xmake.lua b/xmake/toolchains/rust/xmake.lua
index e997eaa21..210e1b727 100644
--- a/xmake/toolchains/rust/xmake.lua
+++ b/xmake/toolchains/rust/xmake.lua
@@ -29,8 +29,21 @@ toolchain("rust")
set_toolset("rcar", "$(env RC)", "rustc")
on_load(function (toolchain)
+
-- e.g. x86_64-pc-windows-msvc, aarch64-unknown-none
local arch = toolchain:arch()
+ if toolchain:is_plat("android") then
+ local targets = {
+ ["armv5te"] = "arm-linux-androideabi" -- deprecated
+ , ["armv7-a"] = "arm-linux-androideabi" -- deprecated
+ , ["armeabi"] = "arm-linux-androideabi" -- removed in ndk r17
+ , ["armeabi-v7a"] = "arm-linux-androideabi"
+ , ["arm64-v8a"] = "aarch64-linux-android"
+ }
+ if targets[arch] then
+ arch = targets[arch]
+ end
+ end
if arch and #arch:split("%-") > 1 then
toolchain:add("rcshflags", "--target=" .. arch)
toolchain:add("rcldflags", "--target=" .. arch)