diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index a62afa620..7a53082a7 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -4,22 +4,25 @@ version = "0.0.1" authors = [] [dependencies] -libc = { git = "https://github.com/rust-lang/libc.git" } getopts = "*" time = { version = "*", optional = true } data-encoding = { version = "^1.1", optional = true } +[dependencies.libc] +git = "https://github.com/rust-lang/libc.git" +optional = true + [features] -fs = [] +fs = ["libc"] utf8 = [] encoding = ["data-encoding"] parse_time = [] -utmpx = ["time"] -c_types = [] -process = [] +utmpx = ["time", "libc"] +c_types = ["libc"] +process = ["libc"] signals = [] wide = [] -default = ["fs", "utf8", "encoding", "parse_time", "utmpx", "c_types", "process", "signals", "wide"] +default = ["fs", "libc", "utf8", "encoding", "parse_time", "utmpx", "c_types", "process", "signals", "wide"] [lib] path = "lib.rs" diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index 994112b74..86e24a07a 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "libc")] pub extern crate libc; #[macro_use]