diff --git a/cmake/FindRust.cmake b/cmake/FindRust.cmake index 535e001c..37adb8ee 100644 --- a/cmake/FindRust.cmake +++ b/cmake/FindRust.cmake @@ -187,8 +187,10 @@ function(_corrosion_determine_libs_new target_triple out_libs out_flags) endif() endforeach() set(libs_list "${stripped_lib_list}") - # Special case `msvcrt` to link with the debug version in Debug mode. - list(TRANSFORM libs_list REPLACE "^msvcrt$" "\$<\$:msvcrtd>") + # We leave it up to the C/C++ executable that links in the Rust static-library + # to determine which version of the msvc runtime library it should select. + list(FILTER libs_list EXCLUDE REGEX "^msvcrtd?") + list(FILTER flag_list EXCLUDE REGEX "^/defaultlib:msvcrtd?") else() message(DEBUG "Determining required native libraries - failed: Regex match failure.") message(DEBUG "`native-static-libs` not found in: `${cargo_build_error_message}`")