Skip to content

Commit

Permalink
target.contains("apple-ios")
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenehp committed Jun 6, 2024
1 parent 4eecbe5 commit cc554fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ fn build(sdk_path: Option<&str>, target: &str) {
// Since iOS 10.0, macOS 10.12, visionOS 1.0, all the functionality in AudioUnit
// moved to AudioToolbox, and the AudioUnit headers have been simple
// wrappers ever since.
if target.contains("apple-ios") {
if target.contains("apple-ios") || target.contains("apple-visionos") {
// On iOS, the AudioUnit framework does not have (and never had) an
// actual dylib to link to, it is just a few header files.
// The AudioToolbox framework contains the symbols instead.
println!("cargo:rustc-link-lib=framework=AudioToolbox");
headers.push("AudioToolbox/AudioUnit.h");
} else {
// On macOS, the symbols are present in the AudioToolbox framework,
// but only on macOS 10.12 and above.
Expand All @@ -73,8 +74,8 @@ fn build(sdk_path: Option<&str>, target: &str) {
// contains a dylib with the desired symbols, that we can link to
// (in later versions just re-exports from AudioToolbox).
println!("cargo:rustc-link-lib=framework=AudioUnit");
headers.push("AudioUnit/AudioUnit.h");
}
headers.push("AudioUnit/AudioUnit.h");
}

#[cfg(feature = "audio_toolbox")]
Expand Down

0 comments on commit cc554fe

Please sign in to comment.