From e79c7d498556faa17d346cec1bac55ad4aa83c3e Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 13 Jul 2022 01:37:05 +0200 Subject: [PATCH 1/3] InputCommon: Don't force-link against SDL2.lib on Windows. --- Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 6dec6003fd..0d7494142d 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -16,8 +16,6 @@ #ifdef _WIN32 #include - -#pragma comment(lib, "SDL2.lib") #endif namespace ciface::SDL From e2e7bc2fa3d88d229c892d132c1112d6246e4c3d Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 13 Jul 2022 01:42:54 +0200 Subject: [PATCH 2/3] CMake: Disable warnings and only build static lib for SDL from externals. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1346b6da95..c7da439b18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -619,11 +619,22 @@ if(ENABLE_SDL) message(STATUS "Using system SDL2") else() 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_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) 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) endif() add_definitions(-DHAVE_SDL2=1) From 869dab51731a22e6ef0292ba133912f646a22791 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Thu, 14 Jul 2022 18:40:18 +0200 Subject: [PATCH 3/3] CMake: Use system C library for SDL from externals. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7da439b18..91f41c2942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -628,6 +628,7 @@ if(ENABLE_SDL) set(SDL_STATIC_ENABLED_BY_DEFAULT ON) set(SDL_TEST OFF) set(SDL_TEST_ENABLED_BY_DEFAULT OFF) + set(OPT_DEF_LIBC ON) add_subdirectory(Externals/SDL/SDL) if (TARGET SDL2) dolphin_disable_warnings_msvc(SDL2)