From 99cdbb88603b0e83235eaaf722a984b2e13d60cb Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 22 Dec 2019 17:46:21 +0000 Subject: [PATCH] cmake: Remove libcmt from SDL bin in debug mode. For the SDL binary vbam when built with MSVC add /nodefaultlib:libcmt to debug link flags, because in debug mode libcmtd is linked and libcmt should not be. This is the same as was done for the wx executable in cf9a88df. Signed-off-by: Rafael Kitover --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b875bb14..08476a4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1007,6 +1007,11 @@ if(ENABLE_SDL) set(WIN32_LIBRARIES wsock32 ws2_32 winmm version imm32) endif() + if(MSVC) + # the debug lib libcmtd is linked in debug mode, so don't link the normal version + set_target_properties(vbam PROPERTIES LINK_FLAGS_DEBUG "/nodefaultlib:libcmt") + endif() + if(ENABLE_LIRC) set(LIRC_CLIENT_LIBRARY lirc_client) endif()