diff --git a/.travis.yml b/.travis.yml index eea814f..d87bf08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,6 @@ before_script: - if [ "$TRAVIS_OS_NAME" = linux ]; then rustup target add x86_64-apple-darwin; fi script: - if [ "$TRAVIS_OS_NAME" = linux ]; then curl -sL https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz | tar -Jxf -; export COREAUDIO_SDK_PATH="$PWD/MacOSX10.13.sdk"; fi -- RUSTFMT=rustfmt cargo build --verbose --target=x86_64-apple-darwin +- rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios +- for i in x86_64-apple-darwin aarch64-apple-ios armv7-apple-ios armv7s-apple-ios; do RUSTFMT=rustfmt cargo build --verbose --target=$i; done - if [ "$TRAVIS_OS_NAME" = osx ]; then RUSTFMT=rustfmt cargo test --verbose; fi diff --git a/build.rs b/build.rs index 2b511e0..dad3234 100644 --- a/build.rs +++ b/build.rs @@ -54,7 +54,12 @@ fn build(sdk_path: Option<&str>, target: &str) { #[cfg(feature = "core_audio")] { println!("cargo:rustc-link-lib=framework=CoreAudio"); - headers.push("CoreAudio/CoreAudio.h"); + + if target.contains("apple-ios") { + headers.push("CoreAudio/CoreAudioTypes.h"); + } else { + headers.push("CoreAudio/CoreAudio.h"); + } } #[cfg(feature = "open_al")] @@ -79,7 +84,14 @@ fn build(sdk_path: Option<&str>, target: &str) { // Begin building the bindgen params. let mut builder = bindgen::Builder::default(); - builder = builder.clang_args(&[&format!("--target={}", target)]); + if target == "aarch64-apple-ios" { + // See https://github.com/rust-lang/rust-bindgen/issues/1211 + // Technically according to the llvm mailing list, the argument to clang here should be + // -arch arm64 but it looks cleaner to just change the target. + builder = builder.clang_args(&[&format!("--target={}", "arm64-apple-ios")]); + } else { + builder = builder.clang_args(&[&format!("--target={}", target)]); + } if let Some(sdk_path) = sdk_path { builder = builder.clang_args(&["-isysroot", sdk_path]);