Skip to content

Commit a46d2d5

Browse files
committed
wip3
1 parent 309a57f commit a46d2d5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/mix/tasks/package_android_runtime2.ex

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule Mix.Tasks.Package.Android.Runtime2 do
1515
name: "arm-unknown-linux-androideabi",
1616
android_name: "androideabi",
1717
android_type: "armeabi-v7a",
18-
cflags: ""
18+
cflags: "--target=arm-linux-android23"
1919
},
2020
"arm64" => %{
2121
xcomp: "arm64-android",
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Package.Android.Runtime2 do
2727
name: "aarch64-unknown-linux-androideabi",
2828
android_name: "android",
2929
android_type: "arm64-v8a",
30-
cflags: ""
30+
cflags: "--target=aarch64-linux-android23"
3131
},
3232
"x86_64" => %{
3333
xcomp: "x86_64-android",
@@ -39,7 +39,7 @@ defmodule Mix.Tasks.Package.Android.Runtime2 do
3939
name: "x86_64-pc-linux-androideabi",
4040
android_name: "android",
4141
android_type: "x86_64",
42-
cflags: ""
42+
cflags: "--target=x86_64-linux-android23"
4343
}
4444
}
4545
|> Map.new()
@@ -326,13 +326,11 @@ defmodule Mix.Tasks.Package.Android.Runtime2 do
326326
end
327327

328328
defp toolpath(bin, tool, arch) do
329-
abi_name = "#{arch.cpu}-linux-#{arch.android_name}-#{tool}"
330-
331-
cond do
332-
File.exists?(Path.join(bin, tool)) -> tool
333-
File.exists?(Path.join(bin, "llvm-" <> tool)) -> "llvm-" <> tool
334-
File.exists?(Path.join(bin, abi_name)) -> abi_name
335-
true -> raise "Tool not found: #{abi_name}"
329+
[tool, "llvm-" <> tool, "#{arch.cpu}-linux-#{arch.android_name}-#{tool}"]
330+
|> Enum.find(fn name -> File.exists?(Path.join(bin, name)) end)
331+
|> case do
332+
nil -> raise "Tool not found: #{tool}"
333+
name -> Path.absname(Path.join(bin, name))
336334
end
337335
end
338336
end

0 commit comments

Comments
 (0)