]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | #![deny(warnings)] |
2 | ||
3 | use std::env; | |
4 | ||
5 | fn main() { | |
6 | let target = env::var("TARGET").expect("TARGET was not set"); | |
7 | if target.contains("-uwp-windows-") { | |
8 | // for BCryptGenRandom | |
9 | println!("cargo:rustc-link-lib=bcrypt"); | |
10 | } else if target.contains("windows") { | |
11 | // for RtlGenRandom (aka SystemFunction036) | |
12 | println!("cargo:rustc-link-lib=advapi32"); | |
13 | } else if target.contains("apple-ios") { | |
14 | // for SecRandomCopyBytes and kSecRandomDefault | |
15 | println!("cargo:rustc-link-lib=framework=Security"); | |
16 | } | |
17 | } |