Skip to content

Commit a33bb3a

Browse files
committed
Tweak Cargo.toml
1 parent 076898e commit a33bb3a

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

Cargo.toml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,56 @@ cfg-if = "1"
1818
compiler_builtins = { version = "0.1", optional = true }
1919
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
2020

21-
[target.'cfg(all(unix, not(getrandom_backend = "linux_rustix")))'.dependencies]
21+
# apple-other
22+
[target.'cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos"))'.dependencies]
2223
libc = { version = "0.2.154", default-features = false }
2324

24-
[target.'cfg(all(getrandom_backend = "linux_rustix", any(target_os = "linux", target_os = "android")))'.dependencies]
25+
# vxworks
26+
[target.'cfg(target_os = "vxworks")'.dependencies]
27+
libc = { version = "0.2.154", default-features = false }
28+
29+
# use_file
30+
[target.'cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix"))'.dependencies]
31+
libc = { version = "0.2.154", default-features = false }
32+
33+
# solaris
34+
[target.'cfg(target_os = "solaris")'.dependencies]
35+
libc = { version = "0.2.154", default-features = false }
36+
37+
# getentropy
38+
[target.'cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten"))'.dependencies]
39+
libc = { version = "0.2.154", default-features = false }
40+
41+
# getrandom
42+
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm")))'.dependencies]
43+
libc = { version = "0.2.154", default-features = false }
44+
45+
# linux_android / linux_android_with_fallback
46+
[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "linux_rustix", getrandom_backend = "custom"))))'.dependencies]
47+
libc = { version = "0.2.154", default-features = false }
48+
49+
# linux_rustix
50+
[target.'cfg(all(any(target_os = "linux", target_os = "android"), any(target_env = "", getrandom_backend = "linux_rustix")))'.dependencies]
2551
rustix = { version = "0.38", default-features = false, features = ["rand"] }
2652

53+
# wasi (0.2 only)
2754
[target.'cfg(all(target_arch = "wasm32", target_os = "wasi", target_env = "p2"))'.dependencies]
2855
wasi = { version = "0.13", default-features = false }
2956

57+
# windows7
3058
[target.'cfg(all(windows, not(target_vendor = "win7")))'.dependencies]
3159
windows-targets = "0.52"
3260

61+
# wasm_js
3362
[target.'cfg(all(getrandom_backend = "wasm_js", any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dependencies]
3463
wasm-bindgen = { version = "0.2.89", default-features = false }
3564
js-sys = "0.3"
36-
[target.'cfg(all(getrandom_backend = "wasm_js", getrandom_browser_test, any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dev-dependencies]
65+
[target.'cfg(all(getrandom_backend = "wasm_js", getrandom_browser_test, target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
3766
wasm-bindgen-test = "0.3.39"
3867

3968
[features]
40-
# Implement std-only traits for getrandom::Error
69+
# Implement std::error::Error for getrandom::Error and
70+
# use std to retrieve OS error descriptions
4171
std = []
4272
# Unstable feature to support being a libstd dependency
4373
rustc-dep-of-std = ["compiler_builtins", "core"]

0 commit comments

Comments
 (0)