From 3c3226705e26bb6ef5c82dcb9a8312be74308c2d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 9 Jul 2019 11:41:28 -0400 Subject: [PATCH] Link to Windows debug CRTs when crt-debug target_feature is present. --- src/windows/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/windows/mod.rs b/src/windows/mod.rs index be28b70f5664f..3ddf4cfa20bd6 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -193,8 +193,10 @@ pub const SIG_ERR: ::c_int = -1; // inline comment below appeases style checker #[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if " -#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] -#[link(name = "libcmt", cfg(target_feature = "crt-static"))] +#[link(name = "msvcrt", cfg(all(not(target_feature = "crt-static"), not(target_feature = "crt-debug"))))] +#[link(name = "msvcrtd", cfg(all(not(target_feature = "crt-static"), target_feature = "crt-debug")))] +#[link(name = "libcmt", cfg(all(target_feature = "crt-static", not(target_feature = "crt-debug"))))] +#[link(name = "libcmtd", cfg(all(target_feature = "crt-static", target_feature = "crt-debug")))] extern {} #[cfg_attr(feature = "extra_traits", derive(Debug))]