Skip to content

Commit

Permalink
CMake: Remove code that depends on CMake < 3.16
Browse files Browse the repository at this point in the history
Is unsupported since a while.
  • Loading branch information
Ghabry committed Feb 10, 2025
1 parent 1fcaff0 commit e5875cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
38 changes: 2 additions & 36 deletions builds/cmake/Modules/PlayerConfigureWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,8 @@ if(WIN32)
endif()

if(MSVC)
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
message(WARNING "Your CMake version is older than 3.15")
message(WARNING "For proper MSVC runtime library support upgrade to a newer version")

option(SHARED_RUNTIME "Windows: Build using the shared runtime library (/MD), disable for static runtime (/MT)" ON)

# Set compiler options.
set(variables
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
if(SHARED_RUNTIME)
message(STATUS "Windows: Using dynamic runtime library (/MD)")
foreach(variable ${variables})
if(${variable} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
endif()
endforeach()
else()
message(STATUS "Windows: Using static runtime library (/MT)")
foreach(variable ${variables})
if(${variable} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
endif()
endforeach()
endif()
else()
# Depends on vcpkg but we don't support anything else
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "")
endif()
# Depends on vcpkg but we don't support anything else
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "")

option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON)
if (MSVC_MULTICORE)
Expand Down
5 changes: 0 additions & 5 deletions builds/libretro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.16...3.31 FATAL_ERROR)

project(retro_common VERSION 1.0 LANGUAGES C)

# Only for ugly MD-MT patching on old versions, new CMAKE_MSVC_RUNTIME_LIBRARY is inherited
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
include(ConfigureWindows)
endif()

# Check availability of libretro-common submodule
file(GLOB RETRO_COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libretro-common/*)
list(LENGTH RETRO_COMMON_DIR RETRO_COMMON_DIR_LEN)
Expand Down

0 comments on commit e5875cc

Please sign in to comment.