diff options
| author | 2021-04-20 10:19:03 -0700 | |
|---|---|---|
| committer | 2021-04-20 10:19:03 -0700 | |
| commit | 7083c5bfc8b6990ac9cd0758a452fbd75c15f3d2 (patch) | |
| tree | 0c80f17141b77304f932b7eaecd5834d22845700 | |
| parent | Merge pull request #6217 from Morph1984/consistent-writebuffers (diff) | |
| parent | general: Ignore implicit-fallthrough for SDL.h (diff) | |
| download | yuzu-7083c5bfc8b6990ac9cd0758a452fbd75c15f3d2.tar.gz yuzu-7083c5bfc8b6990ac9cd0758a452fbd75c15f3d2.tar.xz yuzu-7083c5bfc8b6990ac9cd0758a452fbd75c15f3d2.zip | |
Merge pull request #6207 from lat9nq/sdl-2.0.14
cmake: Use SDL 2.0.14 and fix scope issue
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 3 | ||||
| m--------- | externals/SDL | 0 | ||||
| -rw-r--r-- | src/input_common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 8 |
9 files changed, 53 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e208715d7..2c1c3d560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -274,9 +274,9 @@ if (ENABLE_SDL2) | |||
| 274 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 274 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 275 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") | 275 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") |
| 276 | else() | 276 | else() |
| 277 | find_package(SDL2 2.0.12) | 277 | find_package(SDL2 2.0.14) |
| 278 | 278 | ||
| 279 | if(SDL2_FOUND) | 279 | if (SDL2_FOUND) |
| 280 | # Some installations don't set SDL2_LIBRARIES | 280 | # Some installations don't set SDL2_LIBRARIES |
| 281 | if("${SDL2_LIBRARIES}" STREQUAL "") | 281 | if("${SDL2_LIBRARIES}" STREQUAL "") |
| 282 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") | 282 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") |
| @@ -286,10 +286,10 @@ if (ENABLE_SDL2) | |||
| 286 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | 286 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) |
| 287 | add_library(SDL2 INTERFACE) | 287 | add_library(SDL2 INTERFACE) |
| 288 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | 288 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") |
| 289 | else() | ||
| 290 | message(STATUS "SDL2 2.0.14 or newer not found, falling back to externals.") | ||
| 289 | endif() | 291 | endif() |
| 290 | endif() | 292 | endif() |
| 291 | else() | ||
| 292 | set(SDL2_FOUND NO) | ||
| 293 | endif() | 293 | endif() |
| 294 | 294 | ||
| 295 | # Install any missing dependencies with conan install | 295 | # Install any missing dependencies with conan install |
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 6e4591b4e..e044d9730 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -46,8 +46,7 @@ add_library(unicorn-headers INTERFACE) | |||
| 46 | target_include_directories(unicorn-headers INTERFACE ./unicorn/include) | 46 | target_include_directories(unicorn-headers INTERFACE ./unicorn/include) |
| 47 | 47 | ||
| 48 | # SDL2 | 48 | # SDL2 |
| 49 | if (NOT SDL2_FOUND) | 49 | if (NOT SDL2_FOUND AND ENABLE_SDL2) |
| 50 | set(SDL2_FOUND YES) | ||
| 51 | add_subdirectory(SDL EXCLUDE_FROM_ALL) | 50 | add_subdirectory(SDL EXCLUDE_FROM_ALL) |
| 52 | endif() | 51 | endif() |
| 53 | 52 | ||
diff --git a/externals/SDL b/externals/SDL | |||
| Subproject 983bbf9ef3e572a073a6f5877faf1c0b4803527 | Subproject 4cd981609b50ed273d80c635c1ca4c1e5518fb2 | ||
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index c3cfe7efc..de53e1fda 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -62,7 +62,7 @@ else() | |||
| 62 | ) | 62 | ) |
| 63 | endif() | 63 | endif() |
| 64 | 64 | ||
| 65 | if(SDL2_FOUND) | 65 | if (ENABLE_SDL2) |
| 66 | target_sources(input_common PRIVATE | 66 | target_sources(input_common PRIVATE |
| 67 | sdl/sdl_impl.cpp | 67 | sdl/sdl_impl.cpp |
| 68 | sdl/sdl_impl.h | 68 | sdl/sdl_impl.h |
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 9418e78fa..f682a6db4 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -17,7 +17,17 @@ | |||
| 17 | #include <unordered_map> | 17 | #include <unordered_map> |
| 18 | #include <utility> | 18 | #include <utility> |
| 19 | #include <vector> | 19 | #include <vector> |
| 20 | |||
| 21 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 22 | #ifdef __clang__ | ||
| 23 | #pragma clang diagnostic push | ||
| 24 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 25 | #endif | ||
| 20 | #include <SDL.h> | 26 | #include <SDL.h> |
| 27 | #ifdef __clang__ | ||
| 28 | #pragma clang diagnostic pop | ||
| 29 | #endif | ||
| 30 | |||
| 21 | #include "common/logging/log.h" | 31 | #include "common/logging/log.h" |
| 22 | #include "common/param_package.h" | 32 | #include "common/param_package.h" |
| 23 | #include "common/settings_input.h" | 33 | #include "common/settings_input.h" |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 2f984d1b8..7e1d5f379 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -4,7 +4,17 @@ | |||
| 4 | 4 | ||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | #include <sstream> | 6 | #include <sstream> |
| 7 | |||
| 8 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 9 | #ifdef __clang__ | ||
| 10 | #pragma clang diagnostic push | ||
| 11 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 12 | #endif | ||
| 7 | #include <SDL.h> | 13 | #include <SDL.h> |
| 14 | #ifdef __clang__ | ||
| 15 | #pragma clang diagnostic pop | ||
| 16 | #endif | ||
| 17 | |||
| 8 | #include <inih/cpp/INIReader.h> | 18 | #include <inih/cpp/INIReader.h> |
| 9 | #include "common/file_util.h" | 19 | #include "common/file_util.h" |
| 10 | #include "common/logging/log.h" | 20 | #include "common/logging/log.h" |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index ce8b7c218..3bb555a6b 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -2,7 +2,16 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 6 | #ifdef __clang__ | ||
| 7 | #pragma clang diagnostic push | ||
| 8 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 9 | #endif | ||
| 5 | #include <SDL.h> | 10 | #include <SDL.h> |
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic pop | ||
| 13 | #endif | ||
| 14 | |||
| 6 | #include "common/logging/log.h" | 15 | #include "common/logging/log.h" |
| 7 | #include "common/scm_rev.h" | 16 | #include "common/scm_rev.h" |
| 8 | #include "core/core.h" | 17 | #include "core/core.h" |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index a765fa7b3..3c49a300b 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -5,8 +5,18 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | #include <string> | 7 | #include <string> |
| 8 | |||
| 8 | #define SDL_MAIN_HANDLED | 9 | #define SDL_MAIN_HANDLED |
| 10 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic push | ||
| 13 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 14 | #endif | ||
| 9 | #include <SDL.h> | 15 | #include <SDL.h> |
| 16 | #ifdef __clang__ | ||
| 17 | #pragma clang diagnostic pop | ||
| 18 | #endif | ||
| 19 | |||
| 10 | #include <fmt/format.h> | 20 | #include <fmt/format.h> |
| 11 | #include <glad/glad.h> | 21 | #include <glad/glad.h> |
| 12 | #include "common/assert.h" | 22 | #include "common/assert.h" |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index dfd53e285..3401ad4b4 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -16,7 +16,15 @@ | |||
| 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" | 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" |
| 17 | 17 | ||
| 18 | // Include these late to avoid polluting everything with Xlib macros | 18 | // Include these late to avoid polluting everything with Xlib macros |
| 19 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 20 | #ifdef __clang__ | ||
| 21 | #pragma clang diagnostic push | ||
| 22 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 23 | #endif | ||
| 19 | #include <SDL.h> | 24 | #include <SDL.h> |
| 25 | #ifdef __clang__ | ||
| 26 | #pragma clang diagnostic pop | ||
| 27 | #endif | ||
| 20 | #include <SDL_syswm.h> | 28 | #include <SDL_syswm.h> |
| 21 | 29 | ||
| 22 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) | 30 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) |