2021-01-17 12:11:04 +11:00
|
|
|
//! Emits linker flags depending on platforms and features.
|
2020-02-28 13:34:34 +11:00
|
|
|
//!
|
2021-01-17 12:11:04 +11:00
|
|
|
//! (iOS/macOS only right now... maybe tvOS one day?)
|
2020-02-28 13:34:34 +11:00
|
|
|
|
|
|
|
fn main() {
|
2020-04-01 19:04:34 +11:00
|
|
|
let target = std::env::var("TARGET").unwrap();
|
2020-03-18 10:55:09 +11:00
|
|
|
|
2020-04-01 19:04:34 +11:00
|
|
|
println!("cargo:rustc-link-lib=framework=Foundation");
|
|
|
|
|
2021-01-17 12:11:04 +11:00
|
|
|
if target.contains("-ios") {
|
2020-04-01 19:04:34 +11:00
|
|
|
println!("cargo:rustc-link-lib=framework=UIKit");
|
|
|
|
} else {
|
|
|
|
println!("cargo:rustc-link-lib=framework=AppKit");
|
|
|
|
}
|
2020-03-18 13:11:03 +11:00
|
|
|
|
2020-04-01 19:04:34 +11:00
|
|
|
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");
|
2021-01-17 12:11:04 +11:00
|
|
|
|
|
|
|
#[cfg(feature = "quicklook")]
|
|
|
|
println!("cargo:rustc-link-lib=framework=QuickLook");
|
2020-02-28 13:34:34 +11:00
|
|
|
}
|