cmake: Update MbedTLS finder to support MSVC Debug configuration

Natively compiled MbedTLS for Windows will use the non-debug platform
library, which will lead to a linker error when building OBS in debug
configuration with MSVC.

Neutralizing the linker directive for Debug builds on Windows
unbreaks the build configuration without the need to ship separate
debug variants of MbedTLS.
This commit is contained in:
PatTheMav 2024-01-05 21:24:35 +01:00 committed by Ryan Foster
parent ae469d23e1
commit e79b190f68

View file

@ -194,6 +194,7 @@ if(MbedTLS_FOUND)
MbedTLS::MbedTLS
PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_MbedTLS_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${MbedTLS_INCLUDE_DIR}"
INTERFACE_LINK_OPTIONS "$<$<AND:$<PLATFORM_ID:Windows>,$<CONFIG:DEBUG>>:/NODEFAULTLIB:MSVCRT>"
VERSION ${MbedTLS_VERSION})
endif()
endforeach()