Skip to content

Commit f75006f

Browse files
committed
Never use the debug CRT on Windows
See rust-lang/cmake-rs#30 (comment).
1 parent 20acdd6 commit f75006f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

boring-sys/build/main.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,19 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
199199
let src_path = get_boringssl_source_path(config);
200200
let mut boringssl_cmake = cmake::Config::new(src_path);
201201

202-
if config.host == config.target {
202+
if config.env.cmake_toolchain_file.is_some() {
203203
return boringssl_cmake;
204204
}
205205

206-
if config.env.cmake_toolchain_file.is_some() {
206+
if config.target_os == "windows" {
207+
// Explicitly use the non-debug CRT.
208+
// This is required now because newest BoringSSL requires CMake 3.22 which
209+
// uses the new logic with CMAKE_MSVC_RUNTIME_LIBRARY introduced in CMake 3.15.
210+
// https://github.com/rust-lang/cmake-rs/pull/30#issuecomment-2969758499
211+
boringssl_cmake.define("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreadedDLL");
212+
}
213+
214+
if config.host == config.target {
207215
return boringssl_cmake;
208216
}
209217

0 commit comments

Comments
 (0)