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 command
}; };
// Add libraries required per platform. // 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)] #[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. // On unix we need dlopen-related symbols, libmath for a few things, and pthreads.
#[cfg(not(windows))] #[cfg(not(windows))]
let command = command.arg("-ldl").arg("-lm").arg("-pthread"); let command = command.arg("-ldl").arg("-lm").arg("-pthread");

View File

@@ -50,7 +50,11 @@ impl LinkCode {
) )
.arg(&self.libwasmer_path.canonicalize()?); .arg(&self.libwasmer_path.canonicalize()?);
#[cfg(windows)] #[cfg(windows)]
let command = command.arg("-luserenv").arg("-lWs2_32").arg("-ladvapi32"); let command = command
.arg("-luserenv")
.arg("-lWs2_32")
.arg("-ladvapi32")
.arg("-lbcrypt");
#[cfg(not(windows))] #[cfg(not(windows))]
let command = command.arg("-ldl").arg("-lm").arg("-pthread"); let command = command.arg("-ldl").arg("-lm").arg("-pthread");
let output = command.arg("-o").arg(&self.output_path).output()?; let output = command.arg("-o").arg(&self.output_path).output()?;