From 0dbe09d42dbaa59fa3ea8bdd13577b91c76c06a7 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Thu, 26 Oct 2017 18:45:03 -0700 Subject: [PATCH] Support more cross targets Adds support for Android, Linux/ARM, and windows. Bare-metal thumb targets are listed, because they're supported by cross, but they aren't enabled by default as they don't support std and will likely not be used by most projects. I've left off the *linux-musleabi* targets as they are failing with an odd error that is likely due to musl itself. Additionally I've left out iOS targets as that support needs to be added to trust before it should be added here. --- .travis.yml | 30 ++++++++++++++++++++++++++++++ README.md | 28 ++++++++++++++++++++++++++++ ci/install.sh | 20 ++++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/.travis.yml b/.travis.yml index 680947e..b0a401f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,28 @@ matrix: # TODO These are all the build jobs. Adjust as necessary. Comment out what you # don't need include: + # Android + - env: TARGET=aarch64-linux-android DISABLE_TESTS=1 + - env: TARGET=arm-linux-androideabi DISABLE_TESTS=1 + - env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1 + - env: TARGET=i686-linux-android DISABLE_TESTS=1 + - env: TARGET=x86_64-linux-android DISABLE_TESTS=1 + + # iOS + - env: TARGET=aarch64-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=armv7-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=armv7s-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=i386-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=x86_64-apple-ios DISABLE_TESTS=1 + os: osx + # Linux - env: TARGET=aarch64-unknown-linux-gnu + - env: TARGET=arm-unknown-linux-gnueabi - env: TARGET=armv7-unknown-linux-gnueabihf - env: TARGET=i686-unknown-linux-gnu - env: TARGET=i686-unknown-linux-musl @@ -45,6 +65,16 @@ matrix: - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 + # Windows + - env: TARGET=x86_64-pc-windows-gnu + + # Bare metal + # These targets don't support std and as such are likely not suitable for + # most crates. + # - env: TARGET=thumbv6m-none-eabi + # - env: TARGET=thumbv7em-none-eabi + # - env: TARGET=thumbv7em-none-eabihf + # - env: TARGET=thumbv7m-none-eabi # Testing other channels - env: TARGET=x86_64-unknown-linux-gnu diff --git a/README.md b/README.md index aa1bd68..8528f0c 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,32 @@ check if using a newer release (see `ci/install.sh`) would [fix your problem](https://github.com/japaric/cross/blob/master/CHANGELOG.md). +### Android + +- aarch64-linux-android + +- arm-linux-androideabi + +- armv7-linux-androideabi + +- i686-linux-android + +- x86_64-linux-android + +### iOS + +- aarch64-apple-ios + +- armv7-apple-ios + +- armv7s-apple-ios + +- i386-apple-ios + +- x86_64-apple-ios + +### Linux + - `i686-unknown-linux-gnu` - `i686-unknown-linux-musl` @@ -130,6 +156,8 @@ would - `aarch64-unknown-linux-gnu` +- `arm-unknown-linux-gnueabi` + - `armv7-unknown-linux-gnueabihf` - `mips-unknown-linux-gnu` diff --git a/ci/install.sh b/ci/install.sh index 748ad9a..80e18e4 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -10,6 +10,26 @@ main() { sort=gsort # for `sort --sort-version`, from brew's coreutils. fi + # Builds for iOS are done on OSX, but require the specific target to be + # installed. + case $TARGET in + aarch64-apple-ios) + rustup target install aarch64-apple-ios + ;; + armv7-apple-ios) + rustup target install armv7-apple-ios + ;; + armv7s-apple-ios) + rustup target install armv7s-apple-ios + ;; + i386-apple-ios) + rustup target install i386-apple-ios + ;; + x86_64-apple-ios) + rustup target install x86_64-apple-ios + ;; + esac + # This fetches latest stable release local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ | cut -d/ -f3 \