2020-08-11 17:11:19 +00:00
|
|
|
fn main() {
|
|
|
|
if std::env::var("TARGET").unwrap().contains("-apple") {
|
2020-08-13 16:08:00 +00:00
|
|
|
println!("cargo:rustc-link-lib=framework=AVFoundation");
|
2020-11-17 22:36:33 +00:00
|
|
|
if !std::env::var("CARGO_CFG_TARGET_OS")
|
|
|
|
.unwrap()
|
|
|
|
.contains("ios")
|
|
|
|
{
|
2020-09-02 21:37:07 +00:00
|
|
|
println!("cargo:rustc-link-lib=framework=AppKit");
|
|
|
|
}
|
2020-08-11 17:11:19 +00:00
|
|
|
}
|
2021-03-06 09:56:57 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "ffi")]
|
|
|
|
generate_c_bindings();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "ffi")]
|
|
|
|
fn generate_c_bindings() {
|
|
|
|
use std::path::PathBuf;
|
|
|
|
let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
let mut header_path: PathBuf = std::env::var("OUT_DIR").unwrap().into();
|
|
|
|
header_path.push("tts.h");
|
|
|
|
cbindgen::generate(crate_dir)
|
|
|
|
.unwrap()
|
|
|
|
.write_to_file(header_path);
|
2020-08-11 17:11:19 +00:00
|
|
|
}
|