From cc554fe7529723f4fe0122f66bf6218db885b604 Mon Sep 17 00:00:00 2001 From: Eugene Hauptmann Date: Wed, 5 Jun 2024 20:00:26 -0400 Subject: [PATCH] target.contains("apple-ios") --- build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 16c94b9..10d5d5b 100644 --- a/build.rs +++ b/build.rs @@ -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. @@ -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")]