opencore-amr support android

pull/2767/head
ping 2 years ago
parent 7e7b19d2de
commit aa19a9f541
No known key found for this signature in database
GPG Key ID: E190FCE890D3B329
  1. 32
      packages/o/opencore-amr/xmake.lua

@ -17,7 +17,37 @@ package("opencore-amr")
if package:is_plat("linux") and package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
if is_plat("android") then
import("core.tool.toolchain")
local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()})
local cxflags = ndk:get("cxflags")
local cflags = table.join(table.wrap(cxflags), ndk:get("cflags"))
local cxxflags = table.join(table.wrap(cxflags), ndk:get("cxxflags"))
local sysincludedirs = ndk:get("sysincludedirs")
for _, includedir in ipairs(sysincludedirs) do
table.insert(cflags, "-I" .. includedir)
table.insert(cxxflags, "-I" .. includedir)
end
local cc = package:tool("cc")
local cxx = package:tool("cxx")
local cpp = package:tool("cpp")
local as = package:tool("as")
local ar = package:tool("ar")
import("package.tools.autoconf").install(package, configs, {
envs = {
CC = cc, CXX = cxx, CPP = cpp,
AR = ar, AS = as,
CFLAGS = table.concat(cflags, ' '),
CXXFLAGS = table.concat(cxxflags, ' '),
}
})
else
import("package.tools.autoconf").install(package, configs)
end
end)
on_test(function (package)

Loading…
Cancel
Save