//! Build script for beamer-au.
//!
//! NOTE: ObjC compilation is now handled by xtask with plugin-specific class names.
//! This build script only links required frameworks.

fn main() {
    #[cfg(target_os = "macos")]
    {
        // Link required frameworks
        println!("cargo:rustc-link-lib=framework=AudioToolbox");
        println!("cargo:rustc-link-lib=framework=AVFoundation");
        println!("cargo:rustc-link-lib=framework=Foundation");
        println!("cargo:rustc-link-lib=framework=CoreAudio");

        // Export the output directory so xtask can find the header files.
        // Due to `links = "beamer_au_native"` in Cargo.toml, this becomes
        // DEP_BEAMER_AU_NATIVE_OUT_DIR in dependent build scripts.
        let out_dir = std::env::var("OUT_DIR").unwrap();
        println!("cargo:out_dir={}", out_dir);

        // Rerun if header changes (ObjC sources are now generated by xtask)
        println!("cargo:rerun-if-changed=objc/BeamerAuBridge.h");
    }
}
