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:
Nils Andreas Svee committed 2026-07-17 01:43:10 +07:00
1 parent b56c8b72cc
commit c5d673fcb8
3 files changed
+23 -5

No files matched your search

+3 -1
View File
@@ -25,7 +25,6 @@ netlink-bindings = { git = "https://github.com/one-d-wide/netlink-bindings.git",
netlink-socket2 = { git = "https://github.com/one-d-wide/netlink-bindings.git", rev = "0b609e9380610e7da73f8c43cdf804a1d1bf5474" }
fastrand = "2"
rustix = { version = "1.1", features = ["fs", "system", "thread", "time"] }
rust-uci = { git = "https://github.com/namib-project/rust-uci.git", rev = "3e7b6153b6df92b45428c32bb6461756563deecb", optional = true }
thiserror = "2.0"
libc = "0.2"
flume = { version = "0.12.0", default-features = false, features = ["eventual-fairness", "select"] }
@@ -34,5 +33,8 @@ flume = { version = "0.12.0", default-features = false, features = ["eventual-f
features = ["std"]
version = "0.4"
[target.'cfg(target_os = "linux")'.dependencies]
rust-uci = { git = "https://github.com/namib-project/rust-uci.git", rev = "3e7b6153b6df92b45428c32bb6461756563deecb", optional = true }
[features]
uci = ["dep:rust-uci"]