diff --git a/src/lib.rs b/src/lib.rs index bdd437a6..cfe5f63b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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" }