summaryrefslogtreecommitdiff
path: root/xmake/toolchains/rust/xmake.lua
diff options
context:
space:
mode:
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)