From d33d30fd2086ed5ed0214d598cd86a51350e1061 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:54:14 +1100 Subject: [PATCH] Use debug version of MSVC runtime library on debug Fixed #1230 --- src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bdd437a6..37d5a1d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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" + } } } };