Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ 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
- if [ "$TRAVIS_OS_NAME" = osx ]; then RUSTFMT=rustfmt cargo test --verbose; fi
- if [ "$TRAVIS_OS_NAME" = osx ]; then rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios; for i in aarch64-apple-ios armv7-apple-ios armv7s-apple-ios; do RUSTFMT=rustfmt cargo build --verbose --target=$i; done; fi
16 changes: 14 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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]);
Expand Down