summaryrefslogtreecommitdiff
path: root/Cargo.toml
diff options
context:
space:
mode:
authorVincent Dagonneau <vincentdagonneau@gmail.com>2020-03-19 11:40:53 +0100
committerAlan Somers <asomers@gmail.com>2021-12-20 18:47:16 -0700
commit5f5b7d4d7a76575673b57e685c13ba2c52c4183e (patch)
tree75b45fc8b1b70750783e89069bc4d90810c500fe /Cargo.toml
parentd1c6fed481638405b0a87e5b7eecf82ce89b2268 (diff)
downloadnix-5f5b7d4d7a76575673b57e685c13ba2c52c4183e.zip
feature-gate most Nix functions
Using features reduces build time and size for consumer crates. By default all features are enabled.
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml43
1 files changed, 43 insertions, 0 deletions
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"