diff --git a/core_lib/Cargo.toml b/core_lib/Cargo.toml index c263fd8..0611b51 100644 --- a/core_lib/Cargo.toml +++ b/core_lib/Cargo.toml @@ -9,11 +9,13 @@ authors = ["martichou"] name = "core_bin" path = "src/bin.rs" +[target.'cfg(target_os = "linux")'.dependencies] +bluer = { version = "0.17", features = ["full"], optional = true } + [dependencies] anyhow = "1.0" arboard = "3.3" base64 = "0.22" -bluer = { version = "0.17", features = ["full"], optional = true } btleplug = "0.11" bytes = "1.5" directories = "5.0" diff --git a/core_lib/src/hdl/mod.rs b/core_lib/src/hdl/mod.rs index d114016..fe55361 100644 --- a/core_lib/src/hdl/mod.rs +++ b/core_lib/src/hdl/mod.rs @@ -10,9 +10,9 @@ use crate::utils::RemoteDeviceInfo; mod ble; pub use ble::*; -#[cfg(feature = "experimental")] +#[cfg(all(feature = "experimental", target_os = "linux"))] mod blea; -#[cfg(feature = "experimental")] +#[cfg(all(feature = "experimental", target_os = "linux"))] pub use blea::*; mod inbound; pub use inbound::*; diff --git a/core_lib/src/lib.rs b/core_lib/src/lib.rs index b718656..f6d465b 100644 --- a/core_lib/src/lib.rs +++ b/core_lib/src/lib.rs @@ -6,7 +6,7 @@ use std::sync::{Arc, Mutex, RwLock}; use anyhow::anyhow; use channel::ChannelMessage; -#[cfg(feature = "experimental")] +#[cfg(all(feature = "experimental", target_os = "linux"))] use hdl::BleAdvertiser; use hdl::MDnsDiscovery; use once_cell::sync::Lazy; @@ -165,7 +165,7 @@ impl RQS { let ctk = CancellationToken::new(); self.discovery_ctk = Some(ctk.clone()); - #[cfg(feature = "experimental")] + #[cfg(all(feature = "experimental", target_os = "linux"))] { let ctk_blea = ctk.clone(); tracker.spawn(async move {