blob: 1beb4ed86bc2caf021245b3fac036b925bb0cc0b [file] [log] [blame]
Joel Galenson4be0c6d2020-07-07 13:20:14 -07001#![deny(warnings)]
2
3use std::env;
4
5fn 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 // to work around unavailability of `target_vendor` on Rust 1.33
11 println!("cargo:rustc-cfg=getrandom_uwp");
12 } else if target.contains("windows") {
13 // for RtlGenRandom (aka SystemFunction036)
14 println!("cargo:rustc-link-lib=advapi32");
15 } else if target.contains("apple-ios") {
16 // for SecRandomCopyBytes and kSecRandomDefault
17 println!("cargo:rustc-link-lib=framework=Security");
18 }
19}