2023-04-16 05:57:34 +00:00
|
|
|
option(SDL2_DISABLE_SDL2MAIN "" ON)
|
|
|
|
option(SDL2_DISABLE_INSTALL "" ON)
|
|
|
|
option(SDL2_DISABLE_UNINSTALL "" ON)
|
2024-08-04 15:24:26 +00:00
|
|
|
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()
|
|
|
|
|
2023-04-16 05:57:34 +00:00
|
|
|
add_subdirectory(SDL)
|
|
|
|
if (TARGET SDL2)
|
2024-03-19 06:08:54 +00:00
|
|
|
dolphin_disable_warnings(SDL2)
|
2023-04-16 05:57:34 +00:00
|
|
|
endif()
|
|
|
|
if (TARGET SDL2-static)
|
2024-03-19 06:08:54 +00:00
|
|
|
dolphin_disable_warnings(SDL2-static)
|
2023-04-16 05:57:34 +00:00
|
|
|
endif()
|