Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 1 | [package] |
| 2 | name = "getrandom" |
David LeGare | 010ab1d | 2022-03-02 16:21:18 +0000 | [diff] [blame] | 3 | version = "0.2.5" # Also update html_root_url in lib.rs when bumping this |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 4 | edition = "2018" |
| 5 | authors = ["The Rand Project Developers"] |
| 6 | license = "MIT OR Apache-2.0" |
| 7 | description = "A small cross-platform library for retrieving random data from system source" |
| 8 | documentation = "https://docs.rs/getrandom" |
| 9 | repository = "https://github.com/rust-random/getrandom" |
| 10 | categories = ["os", "no-std"] |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 11 | exclude = [".*"] |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 12 | |
| 13 | [dependencies] |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 14 | cfg-if = "1" |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 15 | |
| 16 | # When built as part of libstd |
| 17 | compiler_builtins = { version = "0.1", optional = true } |
| 18 | core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" } |
| 19 | |
| 20 | [target.'cfg(unix)'.dependencies] |
| 21 | libc = { version = "0.2.64", default-features = false } |
| 22 | |
| 23 | [target.'cfg(target_os = "wasi")'.dependencies] |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 24 | wasi = "0.10" |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 25 | |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 26 | [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] |
| 27 | wasm-bindgen = { version = "0.2.62", default-features = false, optional = true } |
| 28 | js-sys = { version = "0.3", optional = true } |
| 29 | [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies] |
| 30 | wasm-bindgen-test = "0.3.18" |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 31 | |
| 32 | [features] |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 33 | # Implement std-only traits for getrandom::Error |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 34 | std = [] |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 35 | # Feature to enable fallback RDRAND-based implementation on x86/x86_64 |
| 36 | rdrand = [] |
| 37 | # Feature to enable JavaScript bindings on wasm32-unknown-unknown |
| 38 | js = ["wasm-bindgen", "js-sys"] |
| 39 | # Feature to enable custom RNG implementations |
| 40 | custom = [] |
Joel Galenson | 4be0c6d | 2020-07-07 13:20:14 -0700 | [diff] [blame] | 41 | # Unstable feature to support being a libstd dependency |
Thiébaud Weksteen | 9791b30 | 2021-03-03 16:30:20 +0100 | [diff] [blame] | 42 | rustc-dep-of-std = [ |
| 43 | "compiler_builtins", |
| 44 | "core", |
| 45 | "libc/rustc-dep-of-std", |
| 46 | "wasi/rustc-dep-of-std", |
| 47 | ] |
| 48 | # Unstable/test-only feature to run wasm-bindgen tests in a browser |
| 49 | test-in-browser = [] |
| 50 | |
| 51 | [package.metadata.docs.rs] |
| 52 | features = ["std", "custom"] |
| 53 | rustdoc-args = ["--cfg", "docsrs"] |