add cross for zlib

pull/90/head^2
ruki 4 years ago
parent 36bd040c25
commit fafd9bdcab
No known key found for this signature in database
GPG Key ID: 809EF06AD42725BD
  1. 30
      .github/workflows/cross_musl.yml
  2. 2
      packages/z/zlib/xmake.lua
  3. 2
      scripts/packages.lua
  4. 30
      scripts/test.lua

@ -0,0 +1,30 @@
name: Cross (Musl)
on:
pull_request:
push:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
arch: [arm, aarch64]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
- name: Installation
run: |
wget https://musl.cc/${{ matrix.arch }}-linux-musleabi-cross.tgz
tar -xvf ${{ matrix.arch }}-linux-musleabi-cross.tgz
- name: Tests
run: |
xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} -p cross --sdk=`pwd`/${{ matrix.arch }}-linux-musleabi-cross

@ -30,7 +30,7 @@ package("zlib")
import("package.tools.autoconf").install(package, {"--static"})
end)
on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", function (package)
on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", "cross", function (package)
import("package.tools.autoconf").configure(package, {host = "", "--static"})
io.gsub("Makefile", "\nAR=.-\n", "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
io.gsub("Makefile", "\nARFLAGS=.-\n", "\nARFLAGS=cr\n")

@ -60,7 +60,7 @@ function main(opt)
local packagefile = path.join(packagedir, "xmake.lua")
local instance = package.load_from_repository(packagename, nil, packagedir, packagefile)
if instance then
for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd"}) do
for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd", "cross"}) do
local archs = platform.archs(plat)
if archs then
local package_archs = {}

@ -6,19 +6,20 @@ import("packages", {alias = "get_packages"})
-- the options
local options =
{
{'v', "verbose", "k", nil, "Enable verbose information." }
, {'D', "diagnosis", "k", nil, "Enable diagnosis information." }
, {nil, "shallow", "k", nil, "Only install the root packages." }
, {'k', "kind", "kv", nil, "Enable static/shared library." }
, {'p', "plat", "kv", nil, "Set the given platform." }
, {'a', "arch", "kv", nil, "Set the given architecture." }
, {'m', "mode", "kv", nil, "Set the given mode." }
, {nil, "cflags", "kv", nil, "Set the cflags." }
, {nil, "cxxflags", "kv", nil, "Set the cxxflags." }
, {nil, "ldflags", "kv", nil, "Set the ldflags." }
, {nil, "ndk", "kv", nil, "Set the android NDK directory." }
, {nil, "mingw", "kv", nil, "Set the MingW directory." }
, {nil, "packages", "vs", nil, "The package list." }
{'v', "verbose", "k", nil, "Enable verbose information." }
, {'D', "diagnosis", "k", nil, "Enable diagnosis information." }
, {nil, "shallow", "k", nil, "Only install the root packages." }
, {'k', "kind", "kv", nil, "Enable static/shared library." }
, {'p', "plat", "kv", nil, "Set the given platform." }
, {'a', "arch", "kv", nil, "Set the given architecture." }
, {'m', "mode", "kv", nil, "Set the given mode." }
, {nil, "cflags", "kv", nil, "Set the cflags." }
, {nil, "cxxflags", "kv", nil, "Set the cxxflags." }
, {nil, "ldflags", "kv", nil, "Set the ldflags." }
, {nil, "ndk", "kv", nil, "Set the android NDK directory." }
, {nil, "sdk", "kv", nil, "Set the SDK directory of cross toolchain." }
, {nil, "mingw", "kv", nil, "Set the MingW directory." }
, {nil, "packages", "vs", nil, "The package list." }
}
-- require packages
@ -42,6 +43,9 @@ function _require_packages(argv, packages)
if argv.ndk then
table.insert(config_argv, "--ndk=" .. argv.ndk)
end
if argv.sdk then
table.insert(config_argv, "--sdk=" .. argv.sdk)
end
if argv.mingw then
table.insert(config_argv, "--mingw=" .. argv.mingw)
end

Loading…
Cancel
Save