build(uci): restrict UCI dependency and feature to Linux targets
Ensure the UCI integration is only compiled on Linux, as the underlying native dependency is platform-specific. Added a build script to warn users when the feature is enabled on unsupported platforms.
This commit is contained in:
3 files changed
+23
-5
No files matched your search
+4
-4
@@ -7,9 +7,9 @@
|
||||
|
||||
use anyhow::Result;
|
||||
use log::Level;
|
||||
#[cfg(feature = "uci")]
|
||||
#[cfg(all(target_os = "linux", feature = "uci"))]
|
||||
use log::warn;
|
||||
#[cfg(feature = "uci")]
|
||||
#[cfg(all(target_os = "linux", feature = "uci"))]
|
||||
use rust_uci::Uci;
|
||||
use std::fmt;
|
||||
use std::fmt::Display;
|
||||
@@ -391,7 +391,7 @@ impl Config {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(feature = "uci")]
|
||||
#[cfg(all(target_os = "linux", feature = "uci"))]
|
||||
fn get_from_uci(key: &str) -> Option<String> {
|
||||
let mut uci = match Uci::new() {
|
||||
Ok(val) => val,
|
||||
@@ -410,7 +410,7 @@ impl Config {
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "uci"))]
|
||||
#[cfg(not(all(target_os = "linux", feature = "uci")))]
|
||||
fn get_from_uci(_: &str) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user