From 5f5b7d4d7a76575673b57e685c13ba2c52c4183e Mon Sep 17 00:00:00 2001 From: Vincent Dagonneau Date: Thu, 19 Mar 2020 11:40:53 +0100 Subject: feature-gate most Nix functions Using features reduces build time and size for consumer crates. By default all features are enabled. --- Cargo.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index d2ca8ee8..e515e4eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ categories = ["os::unix-apis"] include = ["src/**/*", "test/**/*", "LICENSE", "README.md", "CHANGELOG.md"] [package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] targets = [ "x86_64-unknown-linux-gnu", "aarch64-linux-android", @@ -33,6 +34,48 @@ cfg-if = "1.0" [target.'cfg(not(target_os = "redox"))'.dependencies] memoffset = "0.6.3" +[features] +default = [ + "acct", "aio", "dir", "env", "event", "features", "fs", + "hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue", + "net", "personality", "poll", "process", "pthread", "ptrace", "quota", + "reboot", "resource", "sched", "signal", "socket", "term", "time", + "ucontext", "uio", "users", "zerocopy", +] + +acct = [] +aio = [] +dir = ["fs"] +env = [] +event = [] +features = [] +fs = [] +hostname = [] +inotify = [] +ioctl = [] +kmod = [] +mman = [] +mount = ["uio"] +mqueue = ["fs"] +net = ["socket"] +personality = [] +poll = [] +pthread = [] +ptrace = ["process"] +quota = [] +process = [] +reboot = [] +resource = [] +sched = ["process"] +signal = ["process"] +socket = [] +term = [] +time = [] +ucontext = ["signal"] +uio = [] +users = ["features"] +zerocopy = ["fs", "uio"] + [target.'cfg(target_os = "dragonfly")'.build-dependencies] cc = "1" -- cgit v1.2.3