From ad7779892159a8acdf69e474ef02db2195bc7032 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 11 Sep 2026 14:40:11 +0500 Subject: [PATCH] cmake: avoid imported debug config only on MSVC --- cmake/utilities.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/utilities.cmake b/cmake/utilities.cmake index cfcd86edc7..7cc46a4b20 100644 --- a/cmake/utilities.cmake +++ b/cmake/utilities.cmake @@ -271,6 +271,12 @@ endfunction() # by setting `MAP_IMPORTED_CONFIG_` we override the fallback, but multi-config builds # has to be able to find a way to build a target for each config, otherwise configuration would fail. function(avoid_debug_imported_config_fallback) + # Only needed on MSVC to avoid CRT mimsatch. + # On Unix it's usually okay to mix up Debug and Release configs and we shouldn't block it. + if(NOT MSVC) + return() + endif() + foreach(_target ${ARGN}) if(TARGET ${_target}) set_target_properties(${_target} PROPERTIES