From 001c1b29dfa03c6924aaef0135a7eda3a2dea741 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jul 2024 13:17:53 +0200 Subject: [PATCH] cmake: remove SDL_STATIC_VCRT option projects are expected to use CMAKE_MSVC_RUNTIME_LIBRARY to select the runtime library. With current CMake versions, this can be done with: -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=xxx with xxx one of: "MultiThreaded" -> -MT (static non-debug) "MultiThreadedDLL" -> -MD (shared non-debug) "MultiThreadeDebug" -> -MTd (static debug) "MultiThreadedDebugDLL" -> -MDd (shared debug) See CMake documentation for more information: https://cmake.org/cmake/help/latest/policy/CMP0091.html https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html --- CMakeLists.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14be990895..f5eef6cb10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,20 +159,6 @@ if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS) endif() if(MSVC) - 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$<$:Debug>") - endif() - foreach(flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif() - endforeach() - endif() - if(NOT SDL_LIBC) # Make sure /RTC1 is disabled, otherwise it will use functions from the CRT foreach(flag_var