From e6504c8d0a4d42d2a57b68f9d25a0cbbb2c8289e Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 11 Nov 2023 22:23:08 +0800 Subject: fix target for rust --- xmake/toolchains/rust/xmake.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xmake/toolchains/rust') 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) -- cgit v1.3.1