diff --git a/build.rs b/build.rs deleted file mode 100644 index 95f4b90b3..000000000 --- a/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![deny(warnings)] - -use std::env; - -fn main() { - let target = env::var("TARGET").expect("TARGET was not set"); - if target.contains("windows") { - // for BCryptGenRandom - println!("cargo:rustc-link-lib=bcrypt"); - } else if target.contains("apple-ios") { - // for SecRandomCopyBytes and kSecRandomDefault - println!("cargo:rustc-link-lib=framework=Security"); - } -} diff --git a/src/windows.rs b/src/windows.rs index 56b3d07e2..643badd07 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -11,6 +11,7 @@ use core::{ffi::c_void, num::NonZeroU32, ptr}; const BCRYPT_USE_SYSTEM_PREFERRED_RNG: u32 = 0x00000002; +#[link(name = "bcrypt")] extern "system" { fn BCryptGenRandom( hAlgorithm: *mut c_void,