Skip to content

Commit d33d30f

Browse files
authored
Use debug version of MSVC runtime library on debug
Fixed #1230
1 parent 338e434 commit d33d30f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lib.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1945,10 +1945,19 @@ impl Build {
19451945
None => {
19461946
let features = self.getenv("CARGO_CFG_TARGET_FEATURE");
19471947
let features = features.as_deref().unwrap_or_default();
1948+
let debug = self.get_debug();
19481949
if features.to_string_lossy().contains("crt-static") {
1949-
"-MT"
1950+
if debug {
1951+
"-MTd"
1952+
} else {
1953+
"-MT"
1954+
}
19501955
} else {
1951-
"-MD"
1956+
if debug {
1957+
"-MDd"
1958+
} else {
1959+
"-MD"
1960+
}
19521961
}
19531962
}
19541963
};

0 commit comments

Comments
 (0)