Skip to content

Commit 91fd8fb

Browse files
committed
add MSVC support possibly
1 parent da66981 commit 91fd8fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

snmalloc-sys/build.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#[cfg(feature = "build_cc")]
22
fn main() {
3-
let (debug, optim) = if cfg!(feature = "debug") {
4-
(true, "-O0")
3+
let (debug, optim_unix, optim_msvc, prof_msvc_hint) = if cfg!(feature = "debug") {
4+
(true, "-O0", "/O0", "/DEBUG")
55
} else {
6-
(false, "-O3")
6+
(false, "-O3", "/O2", "/RELEASE")
77
};
88
let mut build = cc::Build::new();
99
build.include("snmalloc/src");
@@ -27,7 +27,9 @@ fn main() {
2727
build.flag_if_supported("/Zc:wchar_t");
2828
build.flag_if_supported("/Zc:forScope");
2929
build.flag_if_supported("/Zc:inline");
30-
build.flag_if_supported(optim);
30+
build.flag_if_supported(prof_msvc_hint);
31+
build.flag_if_supported(optim_msvc);
32+
build.flag_if_supported(optim_unix);
3133
build.flag_if_supported("-mcx16");
3234
build.flag_if_supported("-fno-exceptions");
3335
build.flag_if_supported("-fno-rtti");

0 commit comments

Comments
 (0)