From 81627e35bede7770c5ac0c76d79bccbcfd9e7f79 Mon Sep 17 00:00:00 2001 From: taktik Date: Tue, 23 Sep 2025 14:03:39 +0200 Subject: [PATCH] Add `static_crt` option to cpp_build::Config - option is directly passed to cc and thus behaves exactly as it does in the cc crate --- cpp_build/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpp_build/src/lib.rs b/cpp_build/src/lib.rs index 9c4df39..299290b 100644 --- a/cpp_build/src/lib.rs +++ b/cpp_build/src/lib.rs @@ -601,6 +601,15 @@ impl Config { self } + /// Configures whether the /MT flag or the /MD flag will be passed to msvc + /// build tools. + /// + /// This option defaults to `false`, and affect only msvc targets. + pub fn static_crt(&mut self, static_crt: bool) -> &mut Config { + self.cc.static_crt(static_crt); + self + } + /// Extracts `cpp` declarations from the passed-in crate root, and builds /// the associated static library to be linked in to the final binary. ///