CMake: Disable warnings and only build static lib for SDL from externals.

This commit is contained in:
Admiral H. Curtiss 2022-07-13 01:42:54 +02:00
parent e79c7d4985
commit e2e7bc2fa3
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 11 additions and 0 deletions

View File

@ -619,11 +619,22 @@ if(ENABLE_SDL)
message(STATUS "Using system SDL2") message(STATUS "Using system SDL2")
else() else()
message(STATUS "Using static SDL2 from Externals") message(STATUS "Using static SDL2 from Externals")
option(SDL2_DISABLE_SDL2MAIN "" ON)
option(SDL2_DISABLE_INSTALL "" ON)
option(SDL2_DISABLE_UNINSTALL "" ON)
set(SDL_SHARED OFF) set(SDL_SHARED OFF)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF) set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
set(SDL_STATIC ON) set(SDL_STATIC ON)
set(SDL_STATIC_ENABLED_BY_DEFAULT ON) set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
set(SDL_TEST OFF)
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
add_subdirectory(Externals/SDL/SDL) add_subdirectory(Externals/SDL/SDL)
if (TARGET SDL2)
dolphin_disable_warnings_msvc(SDL2)
endif()
if (TARGET SDL2-static)
dolphin_disable_warnings_msvc(SDL2-static)
endif()
set(SDL2_FOUND TRUE) set(SDL2_FOUND TRUE)
endif() endif()
add_definitions(-DHAVE_SDL2=1) add_definitions(-DHAVE_SDL2=1)