diff --git a/.ci/linux/build.sh b/.ci/linux/build.sh index 41e0ca308b..f46dd9bdf1 100755 --- a/.ci/linux/build.sh +++ b/.ci/linux/build.sh @@ -97,8 +97,8 @@ cmake .. -G Ninja \ -DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \ -DCMAKE_C_FLAGS="$ARCH_FLAGS" \ -DYUZU_USE_BUNDLED_QT=OFF \ - -DYUZU_USE_BUNDLED_SDL2=OFF \ - -DYUZU_USE_EXTERNAL_SDL2=ON \ + -DYUZU_USE_BUNDLED_SDL3=OFF \ + -DYUZU_USE_EXTERNAL_SDL3=ON \ -DYUZU_TESTS=OFF \ -DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \ -DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \ diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ff2e9458..a690ebd119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,14 +137,14 @@ if (PLATFORM_FREEBSD) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") endif() -# Set bundled sdl2/qt as dependent options. -# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion -cmake_dependent_option(ENABLE_SDL2 "Enable the SDL2 frontend" ON "NOT ANDROID" OFF) +# Set bundled sdl3/qt as dependent options. +# On Linux system SDL3 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion +cmake_dependent_option(ENABLE_SDL3 "Enable the SDL3 frontend" ON "NOT ANDROID" OFF) -if (ENABLE_SDL2) +if (ENABLE_SDL3) # TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system - cmake_dependent_option(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "NOT MSVC" OFF) - option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}") + cmake_dependent_option(YUZU_USE_EXTERNAL_SDL3 "Compile external SDL3" OFF "NOT MSVC" OFF) + option(YUZU_USE_BUNDLED_SDL3 "Download bundled SDL3 build" "${MSVC}") endif() option(ENABLE_QT "Enable the Qt frontend" ON) @@ -215,7 +215,7 @@ option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" cmake_dependent_option(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF) cmake_dependent_option(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF) -cmake_dependent_option(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL2;NOT ANDROID" OFF) +cmake_dependent_option(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL3;NOT ANDROID" OFF) cmake_dependent_option(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF) @@ -609,10 +609,10 @@ if(ENABLE_CUBEB) endif() endif() -# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package -if (ENABLE_SDL2) - if (YUZU_USE_EXTERNAL_SDL2) - message(STATUS "Using SDL2 from externals.") +# find SDL3 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package +if (ENABLE_SDL3) + if (YUZU_USE_EXTERNAL_SDL3) + message(STATUS "Using SDL3 from externals.") if (NOT WIN32) # Yuzu itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers # Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095) @@ -635,16 +635,16 @@ if (ENABLE_SDL2) if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck") set(SDL_PIPEWIRE OFF) # build errors out with this on - AddJsonPackage("sdl2_steamdeck") + AddJsonPackage("sdl3_steamdeck") else() - AddJsonPackage("sdl2_generic") + AddJsonPackage("sdl3_generic") endif() - elseif (YUZU_USE_BUNDLED_SDL2) - message(STATUS "Using bundled SDL2") - AddJsonPackage(sdl2) + elseif (YUZU_USE_BUNDLED_SDL3) + message(STATUS "Using bundled SDL3") + AddJsonPackage(sdl3) endif() - find_package(SDL2 2.26.4 REQUIRED) + find_package(SDL3 3.2.22 REQUIRED) endif() # List of all FFmpeg components required diff --git a/CMakeModules/CopyYuzuSDLDeps.cmake b/CMakeModules/CopyYuzuSDLDeps.cmake index 464eed5e9c..c3935794ca 100644 --- a/CMakeModules/CopyYuzuSDLDeps.cmake +++ b/CMakeModules/CopyYuzuSDLDeps.cmake @@ -4,5 +4,5 @@ function(copy_yuzu_SDL_deps target_dir) include(WindowsCopyFiles) set(DLL_DEST "$/") - windows_copy_files(${target_dir} ${SDL2_DLL_DIR} ${DLL_DEST} SDL2.dll) + windows_copy_files(${target_dir} ${SDL3_DLL_DIR} ${DLL_DEST} SDL3.dll) endfunction(copy_yuzu_SDL_deps) diff --git a/CMakeModules/MinGWClangCross.cmake b/CMakeModules/MinGWClangCross.cmake index 286a59a7ad..11ed402380 100644 --- a/CMakeModules/MinGWClangCross.cmake +++ b/CMakeModules/MinGWClangCross.cmake @@ -6,7 +6,7 @@ set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR x86_64) set(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) -set(SDL2_PATH ${MINGW_PREFIX}) +set(SDL3_PATH ${MINGW_PREFIX}) set(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) # Specify the cross compiler diff --git a/CMakeModules/MinGWCross.cmake b/CMakeModules/MinGWCross.cmake index 61464f7dae..5cebe81a6e 100644 --- a/CMakeModules/MinGWCross.cmake +++ b/CMakeModules/MinGWCross.cmake @@ -9,7 +9,7 @@ set(CMAKE_HOST_WIN32 TRUE) set(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) -set(SDL2_PATH ${MINGW_PREFIX}) +set(SDL3_PATH ${MINGW_PREFIX}) set(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) # Specify the cross compiler diff --git a/cpmfile.json b/cpmfile.json index f1fd5ce1cf..8c596b67ba 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -157,30 +157,30 @@ "hash": "99779ca9b6e040d36558cadf484f9ffdab5b47bcc8fc72e4d33639d1d60c0ceb4410d335ba445d72a4324e455167fd6769d99b459943aa135bec085dff2d4b7c", "find_args": "MODULE" }, - "sdl2_generic": { - "package": "SDL2", + "sdl3_generic": { + "package": "SDL3", "repo": "libsdl-org/SDL", - "sha": "54772f345a", - "hash": "2a68a0e01c390043aa9d9df63d8a20a52076c88bb460ac4e0f33194ca7d9bc8fadbbcc04e7506872ac4b6354a73fbc267c036f82200da59465789b87c7d9e3a4", + "sha": "a96677bdf6", + "hash": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", "key": "generic", "bundled": true }, - "sdl2_steamdeck": { - "package": "SDL2", + "sdl3_steamdeck": { + "package": "SDL3", "repo": "libsdl-org/SDL", "sha": "cc016b0046", "hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b", "key": "steamdeck", "bundled": true }, - "sdl2": { + "sdl3": { "ci": true, - "package": "SDL2", - "name": "SDL2", - "repo": "crueter-ci/SDL2", - "version": "2.32.8", - "min_version": "2.26.4", - "cmake_filename": "sdl2" + "package": "SDL3", + "name": "SDL3", + "repo": "libsdl-org/SDL3", + "version": "3.2.22", + "min_version": "3.2.0", + "cmake_filename": "sdl3" }, "llvm-mingw": { "repo": "misc/llvm-mingw", diff --git a/docs/Options.md b/docs/Options.md index 3dd84ea645..dc73fecd3e 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -40,12 +40,12 @@ Notes: * Unavailable on OpenBSD The following options are desktop only: -- `ENABLE_SDL2` (ON) Enable the SDL2 desktop, audio, and input frontend (HIGHLY RECOMMENDED!) +- `ENABLE_SDL3` (ON) Enable the SDL2 desktop, audio, and input frontend (HIGHLY RECOMMENDED!) * Unavailable on Android - `YUZU_USE_EXTERNAL_SDL2` (ON for non-UNIX) Compiles SDL2 from source - `YUZU_USE_BUNDLED_SDL2` (ON for MSVC) Download a prebuilt SDL2 * Unavailable on OpenBSD - * Only enabled if YUZU_USE_CPM and ENABLE_SDL2 are both ON + * Only enabled if YUZU_USE_CPM and ENABLE_SDL3 are both ON - `ENABLE_LIBUSB` (ON) Enable the use of the libusb input frontend (HIGHLY RECOMMENDED) - `ENABLE_OPENGL` (ON) Enable the OpenGL graphics frontend * Unavailable on Windows/ARM64 and Android diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88470c4c42..ed209890ab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -223,7 +223,7 @@ if (YUZU_TESTS) add_subdirectory(tests) endif() -if (ENABLE_SDL2 AND YUZU_CMD) +if (ENABLE_SDL3 AND YUZU_CMD) add_subdirectory(yuzu_cmd) set_target_properties(yuzu-cmd PROPERTIES OUTPUT_NAME "eden-cli") endif() diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index e8d8141711..8dedf35446 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -168,7 +168,7 @@ android { cmake { arguments( "-DENABLE_QT=0", // Don't use QT - "-DENABLE_SDL2=0", // Don't use SDL + "-DENABLE_SDL3=0", // Don't use SDL "-DENABLE_WEB_SERVICE=1", // Enable web service "-DENABLE_OPENSSL=ON", "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index c9f8af7dc3..77ac05c7a2 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt @@ -247,14 +247,14 @@ if (ENABLE_CUBEB) target_compile_definitions(audio_core PRIVATE HAVE_CUBEB=1) endif() -if (ENABLE_SDL2) +if (ENABLE_SDL3) target_sources(audio_core PRIVATE sink/sdl2_sink.cpp sink/sdl2_sink.h ) - target_link_libraries(audio_core PRIVATE SDL2::SDL2) - target_compile_definitions(audio_core PRIVATE HAVE_SDL2) + target_link_libraries(audio_core PRIVATE SDL3::SDL3) + target_compile_definitions(audio_core PRIVATE HAVE_SDL3) endif() if(ANDROID) diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index 25ed58620e..4a9b537116 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "audio_core/common/common.h" #include "audio_core/sink/sdl2_sink.h" diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index d455323e05..05a123fd6e 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt @@ -47,7 +47,7 @@ else() ) endif() -if (ENABLE_SDL2) +if (ENABLE_SDL3) target_sources(input_common PRIVATE drivers/joycon.cpp drivers/joycon.h @@ -73,8 +73,8 @@ if (ENABLE_SDL2) helpers/joycon_protocol/rumble.cpp helpers/joycon_protocol/rumble.h ) - target_link_libraries(input_common PRIVATE SDL2::SDL2) - target_compile_definitions(input_common PRIVATE HAVE_SDL2) + target_link_libraries(input_common PRIVATE SDL3::SDL3) + target_compile_definitions(input_common PRIVATE HAVE_SDL3) endif() if (ENABLE_LIBUSB) diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h index a140ad072c..58240d327c 100644 --- a/src/input_common/drivers/sdl_driver.h +++ b/src/input_common/drivers/sdl_driver.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include "common/common_types.h" #include "common/threadsafe_queue.h" diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 00e03bd935..b47cce6137 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -468,9 +468,9 @@ if (YUZU_USE_BUNDLED_QT) copy_yuzu_Qt6_deps(yuzu) endif() -if (ENABLE_SDL2) - target_link_libraries(yuzu PRIVATE SDL2::SDL2) - target_compile_definitions(yuzu PRIVATE HAVE_SDL2) +if (ENABLE_SDL3) + target_link_libraries(yuzu PRIVATE SDL3::SDL3) + target_compile_definitions(yuzu PRIVATE HAVE_SDL3) endif() if (MSVC) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index fc7a953d77..58c1b151e2 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -98,7 +98,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #ifdef HAVE_SDL2 #include #include -#include // For SDL ScreenSaver functions +#include // For SDL ScreenSaver functions #endif #include diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index a60650bc19..47e0f7e5e1 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -41,7 +41,7 @@ target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) create_resource("../../dist/yuzu.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon") target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR}) -target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2) +target_link_libraries(yuzu-cmd PRIVATE SDL3::SDL3) if(UNIX AND NOT APPLE) install(TARGETS yuzu-cmd) diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 4b56f3794b..f0c1100d09 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -3,7 +3,7 @@ // SPDX-FileCopyrightText: 2016 Citra Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include +#include #include "common/logging/log.h" #include "common/scm_rev.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 32f365e0d0..15b634bf63 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -9,7 +9,7 @@ #include #define SDL_MAIN_HANDLED -#include +#include #include #include diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_null.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_null.cpp index 506137bd8a..e4f01ece24 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_null.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_null.cpp @@ -18,7 +18,7 @@ #include #endif -#include +#include EmuWindow_SDL2_Null::EmuWindow_SDL2_Null(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_, bool fullscreen) 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 f509652bf6..ba4b29e9ae 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -12,7 +12,7 @@ #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" -#include +#include #include EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem_, diff --git a/src/yuzu_cmd/sdl_config.cpp b/src/yuzu_cmd/sdl_config.cpp index 6e0f254b6b..5d303571b1 100644 --- a/src/yuzu_cmd/sdl_config.cpp +++ b/src/yuzu_cmd/sdl_config.cpp @@ -3,7 +3,7 @@ // SDL will break our main function in yuzu-cmd if we don't define this before adding SDL.h #define SDL_MAIN_HANDLED -#include +#include #include "common/logging/log.h" #include "input_common/main.h"