Skip to content

Commit

Permalink
Use debug version of MSVC runtime library on debug (#1231)
Browse files Browse the repository at this point in the history
* Use debug version of MSVC runtime library on debug

Fixed #1230

* Fix clippy
  • Loading branch information
NobodyXu authored Oct 6, 2024
1 parent 338e434 commit c80a706
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1945,8 +1945,15 @@ impl Build {
None => {
let features = self.getenv("CARGO_CFG_TARGET_FEATURE");
let features = features.as_deref().unwrap_or_default();
let debug = self.get_debug();
if features.to_string_lossy().contains("crt-static") {
"-MT"
if debug {
"-MTd"
} else {
"-MT"
}
} else if debug {
"-MDd"
} else {
"-MD"
}
Expand Down

0 comments on commit c80a706

Please sign in to comment.