Skip to content

Commit 90646f1

Browse files
committed
Fixed build script
1 parent 880f384 commit 90646f1

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

libmimalloc-sys/build.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,29 @@ use cmake::Config;
44
fn main() {
55
let dst = Config::new("c_src/mimalloc")
66
.build();
7+
8+
dst.push("build");
9+
710
println!("cargo:rustc-link-search=native={}", dst.display());
8-
//println!("cargo:rustc-link-lib=static=libmimalloc");
11+
if cfg!(debug_assertions) {
12+
println!("cargo:rustc-link-lib=static=mimalloc-debug");
13+
} else {
14+
println!("cargo:rustc-link-lib=static=mimalloc");
15+
}
916
}
1017

1118
#[cfg(not(feature = "no_secure"))]
1219
fn main() {
13-
let dst = Config::new("c_src/mimalloc")
20+
let mut dst = Config::new("c_src/mimalloc")
1421
.define("SECURE", "ON")
1522
.build();
23+
24+
dst.push("build");
25+
1626
println!("cargo:rustc-link-search=native={}", dst.display());
17-
//println!("cargo:rustc-link-lib=static=libmimalloc");
27+
if cfg!(debug_assertions) {
28+
println!("cargo:rustc-link-lib=static=mimalloc-debug");
29+
} else {
30+
println!("cargo:rustc-link-lib=static=mimalloc");
31+
}
1832
}

0 commit comments

Comments
 (0)