Build SDL with the static C runtime on Visual Studio

This commit is contained in:
Sam Lantinga
2024-01-20 16:40:32 -08:00
parent e2f35a16c2
commit 5e70ee29cc
7 changed files with 60 additions and 27 deletions

View File

@@ -154,13 +154,12 @@ endif()
set(SDL_LIBC_DEFAULT ON)
set(SDL_SYSTEM_ICONV_DEFAULT ON)
if(WINDOWS)
set(SDL_LIBC_DEFAULT OFF)
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
endif()
if(MSVC)
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
if(SDL_FORCE_STATIC_VCRT)
dep_option(SDL_STATIC_VCRT "Use /MT for static VC runtimes" ON "NOT WINDOWS_STORE" OFF)
if(SDL_STATIC_VCRT)
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()