Add bcrypt which is required by newer getrandom crate on Windows.

This commit is contained in:
Nick Lewycky
2021-02-10 17:52:12 -08:00
parent 2f4e915b76
commit e698ac32ee
2 changed files with 11 additions and 3 deletions

View File

@@ -279,9 +279,13 @@ impl LinkCode {
command
};
// Add libraries required per platform.
// We need userenv, sockets (Ws2_32), and advapi32 to call a system call (for random numbers I think).
// We need userenv, sockets (Ws2_32), advapi32 for some system calls and bcrypt for random numbers.
#[cfg(windows)]
let command = command.arg("-luserenv").arg("-lWs2_32").arg("-ladvapi32");
let command = command
.arg("-luserenv")
.arg("-lWs2_32")
.arg("advapi32")
.arg("-lbcrypt");
// On unix we need dlopen-related symbols, libmath for a few things, and pthreads.
#[cfg(not(windows))]
let command = command.arg("-ldl").arg("-lm").arg("-pthread");