From f4fff27b540a0813a6e7f22eae0daba0825548c1 Mon Sep 17 00:00:00 2001 From: Ryan Clanton <55164720+ryancinsight@users.noreply.github.com> Date: Fri, 19 Mar 2021 10:36:57 -0400 Subject: [PATCH] mingw add Bcrypt --- libmimalloc-sys/build.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libmimalloc-sys/build.rs b/libmimalloc-sys/build.rs index afd18b9..f1b4bcf 100644 --- a/libmimalloc-sys/build.rs +++ b/libmimalloc-sys/build.rs @@ -27,6 +27,9 @@ fn main() { build.define("MI_STATIC_LIB", None); + let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target_os not defined!"); + let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("target_env not defined!"); + let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target_os not defined!"); if cfg!(feature = "override") { @@ -61,4 +64,7 @@ fn main() { } build.compile("mimalloc"); + if (target_os == "windows") && (target_env == "gnu") { + println!("cargo:rustc-link-lib=bcrypt"); + } }