Browse Source

from @rextimmy: appends vcruntime as a release dependency when using visual studio versions exceeding mark 1920, as failure to do so was leading to Error LNK2019 unresolved external symbol memset referenced in function SDL_vsnprintf_REAL
Ported up for the 2.0.12 version

Areloch 5 years ago
parent
commit
bf8455469f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Engine/lib/sdl/CMakeLists.txt

+ 4 - 1
Engine/lib/sdl/CMakeLists.txt

@@ -2062,7 +2062,10 @@ if(SDL_SHARED)
     set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
   endif()
   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
-  target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
+  target_link_libraries(SDL2 PUBLIC ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
+  if(MSVC_VERSION GREATER_EQUAL 1920)
+    target_link_libraries(SDL2 PRIVATE optimized vcruntime)
+  endif()
   target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/SDL2>)
   if (NOT ANDROID)
     set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")