From 9af0ccf7b623d63bfe2bd2b98ea314cbe140404a Mon Sep 17 00:00:00 2001 From: nate-fe2o3 Date: Thu, 16 Jan 2025 12:57:28 -0700 Subject: [PATCH] added target os cfgs to all modules in lib.rs changes compilation on non-MacOS systems from a compile error to a no-op --- system-configuration/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system-configuration/src/lib.rs b/system-configuration/src/lib.rs index 3fa92fd..e80c4e7 100644 --- a/system-configuration/src/lib.rs +++ b/system-configuration/src/lib.rs @@ -16,16 +16,20 @@ //! //! [SystemConfiguration]: https://developer.apple.com/documentation/systemconfiguration?language=objc //! [`system-configuration-sys`]: https://crates.io/crates/system-configuration-sys - #![deny(missing_docs)] - /// CoreFoundation wrappers #[macro_use] +#[cfg(target_os = "macos")] pub extern crate core_foundation; /// Low-level SystemConfiguration bindings +#[cfg(target_os = "macos")] pub extern crate system_configuration_sys as sys; +#[cfg(target_os = "macos")] pub mod dynamic_store; +#[cfg(target_os = "macos")] pub mod network_configuration; +#[cfg(target_os = "macos")] pub mod network_reachability; +#[cfg(target_os = "macos")] pub mod preferences;