Update SDL to release-2.30.6 and fix build errors for Windows and CMake

This commit is contained in:
khg8m3r
2024-08-04 11:24:26 -04:00
committed by Admiral H. Curtiss
parent c824ee9758
commit d2c4f3af19
4 changed files with 54 additions and 13 deletions

View File

@ -1,13 +1,30 @@
option(SDL2_DISABLE_SDL2MAIN "" ON)
option(SDL2_DISABLE_INSTALL "" ON)
option(SDL2_DISABLE_UNINSTALL "" ON)
set(SDL_SHARED OFF)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
set(SDL_STATIC ON)
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
set(SDL_TEST OFF)
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
set(OPT_DEF_LIBC ON)
option(SDL_SHARED "Build a shared version of the library" OFF)
option(SDL_SHARED_ENABLED_BY_DEFAULT "" OFF)
option(SDL_STATIC "Build a static version of the library" ON)
option(SDL_STATIC_ENABLED_BY_DEFAULT "" ON)
option(SDL_TEST "Build the SDL2_test library" OFF)
option(SDL_TEST_ENABLED_BY_DEFAULT "" OFF)
# SDL fails to clean up old headers after version upgrades, so do that manually
set(EXPECTED_SDL_REVISION "SDL-release-2.30.6-0")
if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/SDL2/SDL_revision.h")
file(READ "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/SDL2/SDL_revision.h" ACTUAL_SDL_REVISION)
if (NOT "${ACTUAL_SDL_REVISION}" MATCHES "${EXPECTED_SDL_REVISION}")
message(STATUS "Found unexpected SDL2/SDL_revision.h, removing generated includes.")
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/")
endif()
endif()
if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/SDL_revision.h")
file(READ "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/SDL_revision.h" ACTUAL_SDL_REVISION)
if (NOT "${ACTUAL_SDL_REVISION}" MATCHES "${EXPECTED_SDL_REVISION}")
message(STATUS "Found unexpected SDL_revision.h, removing generated includes.")
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/SDL/include/")
endif()
endif()
add_subdirectory(SDL)
if (TARGET SDL2)
dolphin_disable_warnings(SDL2)