blob: eb5114970ce90a55883f9cbe9bf867888f5c50c6 [file] [log] [blame]
Joel Galenson4be0c6d2020-07-07 13:20:14 -07001[package]
2name = "getrandom"
David LeGare010ab1d2022-03-02 16:21:18 +00003version = "0.2.5" # Also update html_root_url in lib.rs when bumping this
Joel Galenson4be0c6d2020-07-07 13:20:14 -07004edition = "2018"
5authors = ["The Rand Project Developers"]
6license = "MIT OR Apache-2.0"
7description = "A small cross-platform library for retrieving random data from system source"
8documentation = "https://docs.rs/getrandom"
9repository = "https://github.com/rust-random/getrandom"
10categories = ["os", "no-std"]
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010011exclude = [".*"]
Joel Galenson4be0c6d2020-07-07 13:20:14 -070012
13[dependencies]
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010014cfg-if = "1"
Joel Galenson4be0c6d2020-07-07 13:20:14 -070015
16# When built as part of libstd
17compiler_builtins = { version = "0.1", optional = true }
18core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
19
20[target.'cfg(unix)'.dependencies]
21libc = { version = "0.2.64", default-features = false }
22
23[target.'cfg(target_os = "wasi")'.dependencies]
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010024wasi = "0.10"
Joel Galenson4be0c6d2020-07-07 13:20:14 -070025
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010026[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
27wasm-bindgen = { version = "0.2.62", default-features = false, optional = true }
28js-sys = { version = "0.3", optional = true }
29[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
30wasm-bindgen-test = "0.3.18"
Joel Galenson4be0c6d2020-07-07 13:20:14 -070031
32[features]
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010033# Implement std-only traits for getrandom::Error
Joel Galenson4be0c6d2020-07-07 13:20:14 -070034std = []
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010035# Feature to enable fallback RDRAND-based implementation on x86/x86_64
36rdrand = []
37# Feature to enable JavaScript bindings on wasm32-unknown-unknown
38js = ["wasm-bindgen", "js-sys"]
39# Feature to enable custom RNG implementations
40custom = []
Joel Galenson4be0c6d2020-07-07 13:20:14 -070041# Unstable feature to support being a libstd dependency
Thiébaud Weksteen9791b302021-03-03 16:30:20 +010042rustc-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
49test-in-browser = []
50
51[package.metadata.docs.rs]
52features = ["std", "custom"]
53rustdoc-args = ["--cfg", "docsrs"]