diff --git a/appkit/Cargo.toml b/appkit/Cargo.toml index 33bd6c6..bdd13a0 100644 --- a/appkit/Cargo.toml +++ b/appkit/Cargo.toml @@ -19,4 +19,5 @@ uuid = { version = "0.8", features = ["v4"] } url = "2.1.1" [features] +user-notifications = [] enable-webview-downloading = [] diff --git a/appkit/build.rs b/appkit/build.rs index 7a563d7..0fc90dd 100644 --- a/appkit/build.rs +++ b/appkit/build.rs @@ -7,6 +7,8 @@ fn main() { if std::env::var("TARGET").unwrap().contains("-apple") { println!("cargo:rustc-link-lib=framework=Security"); println!("cargo:rustc-link-lib=framework=WebKit"); + + #[cfg(feature = "user-notifications")] println!("cargo:rustc-link-lib=framework=UserNotifications"); } } diff --git a/appkit/src/lib.rs b/appkit/src/lib.rs index e32118e..cf73859 100644 --- a/appkit/src/lib.rs +++ b/appkit/src/lib.rs @@ -34,7 +34,10 @@ pub mod geometry; pub mod layout; pub mod menu; pub mod networking; + +#[cfg(feature = "user-notifications")] pub mod notifications; + pub mod pasteboard; pub mod printing; pub mod toolbar; @@ -53,7 +56,10 @@ pub mod prelude { pub use crate::layout::LayoutConstraint; pub use crate::menu::{Menu, MenuItem}; + + #[cfg(feature = "user-notifications")] pub use crate::notifications::{Notification, NotificationCenter, NotificationAuthOption}; + pub use crate::toolbar::{Toolbar, ToolbarController, ToolbarHandle}; pub use crate::networking::URLRequest;