Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ repository = "https://github.com/RustAudio/coreaudio-sys.git"
build = "build.rs"

[build-dependencies.bindgen]
version = "0.56"
version = "0.59.2"
default-features = false
features = ["runtime"]

[dependencies]
objc = { version = "0.2.7", optional = true }
block = { version = "0.1.6", optional = true }

[features]
default = ["audio_toolbox", "audio_unit", "core_audio", "open_al", "core_midi"]
audio_toolbox = []
Expand Down
19 changes: 16 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,24 @@ fn build(sdk_path: Option<&str>, target: &str) {
if let Some(sdk_path) = sdk_path {
builder = builder.clang_args(&["-isysroot", sdk_path]);
}
if target.contains("apple-ios") {
#[cfg(feature = "objc")]
{
// time.h as has a variable called timezone that conflicts with some of the objective-c
// calls from NSCalendar.h in the Foundation framework. This removes that one variable.
builder = builder.blacklist_item("timezone");
builder = builder.blacklist_item("objc_object");
builder = builder.blocklist_item("timezone");
// fails to derive Copy
builder = builder.blocklist_item("objc_object");
// fails to derive Copy
builder = builder.blocklist_item("AudioUnitRenderContext");

builder = builder.clang_args(&["-x", "objective-c"]);
builder = builder.objc_extern_crate(true);
}
#[cfg(feature = "block")]
{
builder = builder.clang_args(&["-fblocks"]);
builder = builder.generate_block(true);
builder = builder.block_extern_crate(true);
}

let meta_header: Vec<_> = headers
Expand Down