Skip to content

Commit

Permalink
use debug version of C runtime with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Aug 24, 2022
1 parent 53fb72c commit 6dbb0ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ impl Build {
ToolFamily::Msvc { .. } => {
cmd.push_cc_arg("-nologo".into());

let crt_flag = match self.static_crt {
let mut crt_flag: OsString = match self.static_crt {
Some(true) => "-MT",
Some(false) => "-MD",
None => {
Expand All @@ -1500,8 +1500,14 @@ impl Build {
"-MD"
}
}
};
cmd.push_cc_arg(crt_flag.into());
}
.into();

if self.get_debug() {
crt_flag.push("d");
}

cmd.push_cc_arg(crt_flag);

match &opt_level[..] {
// Msvc uses /O1 to enable all optimizations that minimize code size.
Expand Down

0 comments on commit 6dbb0ff

Please sign in to comment.