cacao/build.rs

32 lines
986 B
Rust
Raw Normal View History

//! Emits linker flags depending on platforms and features.
2020-02-28 13:34:34 +11:00
//!
//! (iOS/macOS only right now... maybe tvOS one day?)
2020-02-28 13:34:34 +11:00
fn main() {
let target = std::env::var("TARGET").unwrap();
println!("cargo:rustc-link-lib=framework=Foundation");
if target.contains("-ios") {
println!("cargo:rustc-link-lib=framework=UIKit");
} else {
println!("cargo:rustc-link-lib=framework=AppKit");
}
println!("cargo:rustc-link-lib=framework=CoreGraphics");
println!("cargo:rustc-link-lib=framework=QuartzCore");
println!("cargo:rustc-link-lib=framework=Security");
#[cfg(feature = "webview")]
println!("cargo:rustc-link-lib=framework=WebKit");
#[cfg(feature = "cloudkit")]
println!("cargo:rustc-link-lib=framework=CloudKit");
#[cfg(feature = "user-notifications")]
println!("cargo:rustc-link-lib=framework=UserNotifications");
#[cfg(feature = "quicklook")]
println!("cargo:rustc-link-lib=framework=QuickLook");
2020-02-28 13:34:34 +11:00
}