Skip to content

Commit 6ff9477

Browse files
committed
fix: link necessary libs on Windows
1 parent bae7389 commit 6ff9477

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libmimalloc-sys/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ fn main() {
9191
.define("MI_SHOW_ERRORS", "OFF")
9292
.profile("release")
9393
.static_crt(false);
94+
// Link with libs needed on Windows
95+
// https://github.com/microsoft/mimalloc/blob/af21001f7a65eafb8fb16460b018ebf9d75e2ad8/CMakeLists.txt#L487
96+
// https://github.com/rust-lang/rust/issues/139352
97+
let libs = ["psapi", "shell32", "user32", "advapi32", "bcrypt"];
98+
99+
for lib in libs {
100+
println!("cargo:rustc-link-lib={}", lib);
101+
}
94102
}
95103

96104
let dst = cmake_config.build();

0 commit comments

Comments
 (0)