@@ -18,26 +18,56 @@ cfg-if = "1"
18
18
compiler_builtins = { version = " 0.1" , optional = true }
19
19
core = { version = " 1.0" , optional = true , package = " rustc-std-workspace-core" }
20
20
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 ]
22
23
libc = { version = " 0.2.154" , default-features = false }
23
24
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 ]
25
51
rustix = { version = " 0.38" , default-features = false , features = [" rand" ] }
26
52
53
+ # wasi (0.2 only)
27
54
[target .'cfg(all(target_arch = "wasm32", target_os = "wasi", target_env = "p2"))' .dependencies ]
28
55
wasi = { version = " 0.13" , default-features = false }
29
56
57
+ # windows7
30
58
[target .'cfg(all(windows, not(target_vendor = "win7")))' .dependencies ]
31
59
windows-targets = " 0.52"
32
60
61
+ # wasm_js
33
62
[target .'cfg(all(getrandom_backend = "wasm_js", any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))' .dependencies ]
34
63
wasm-bindgen = { version = " 0.2.89" , default-features = false }
35
64
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 ]
37
66
wasm-bindgen-test = " 0.3.39"
38
67
39
68
[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
41
71
std = []
42
72
# Unstable feature to support being a libstd dependency
43
73
rustc-dep-of-std = [" compiler_builtins" , " core" ]
0 commit comments