Skip to content

Commit

Permalink
Use debug version of MSVC runtime library on debug
Browse files Browse the repository at this point in the history
Fixed #1230
  • Loading branch information
NobodyXu authored Oct 6, 2024
1 parent 338e434 commit d33d30f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1945,10 +1945,19 @@ 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 {
"-MD"
if debug {
"-MDd"
} else {
"-MD"
}
}
}
};
Expand Down

0 comments on commit d33d30f

Please sign in to comment.