From dc8a22cd9c45d2d2da3a3dcc47fac8f63feb39a5 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 6 Jun 2017 13:39:29 -0400 Subject: [PATCH] cmake: don't use /NODEFAULTLIB if we are using the C runtime (thanks, Rob!). Fixes Bugzilla #3640. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3471c45b6..5ff57d9fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1584,7 +1584,7 @@ if(SDL_SHARED) SOVERSION ${LT_REVISION} OUTPUT_NAME "SDL2") endif() - if(MSVC) + if(MSVC AND NOT LIBC) # Don't try to link with the default set of libraries. set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") @@ -1599,7 +1599,7 @@ if(SDL_STATIC) add_library(SDL2-static STATIC ${SOURCE_FILES}) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE ${SDL_STATIC_PIC}) - if(MSVC) + if(MSVC AND NOT LIBC) set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")