diff --git a/src/server.rs b/src/server.rs index 13e3a678d..713b97da6 100644 --- a/src/server.rs +++ b/src/server.rs @@ -13,6 +13,7 @@ use hbb_common::{ sodiumoxide::crypto::{box_, secretbox, sign}, timeout, tokio, ResultType, Stream, }; +#[cfg(target_os = "macos")] use notify::{watcher, RecursiveMode, Watcher}; use parity_tokio_ipc::ConnectionClient; use service::{GenericService, Service, ServiceTmpl, Subscriber}; diff --git a/src/ui.rs b/src/ui.rs index db4e2ba16..6502ec729 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -364,7 +364,8 @@ impl UI { } ipc::set_options(options.clone()).ok(); - if cfg!(target_os = "macos") && &key == "stop-service" { + #[cfg(target_os = "macos")] + if &key == "stop-service" { crate::platform::macos::launch_or_stop_daemon(value != "Y"); } }