Use SDL3 by default if it's available

The support for SDL3 should now be good enough so we can use it by default
if it's available.
This commit is contained in:
Thomas Huth committed 2026-02-22 07:09:42 +01:00
1 parent 177a706bac
commit 25453f13bb
5 files changed
+13 -20

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ cygwin_task:
script:
- C:\tools\cygwin\bin\bash.exe -lc "cd '%cd%' ;
CFLAGS='-Werror -Wno-error=char-subscripts'
cmake -G 'Unix Makefiles' -DENABLE_SDL3=1 ."
cmake -G 'Unix Makefiles' ."
- C:\tools\cygwin\bin\bash.exe -lc "cd '%cd%' ; make -j4"
test_script:
- C:\tools\cygwin\bin\bash.exe -lc "cd '%cd%' ; ctest -j4 --output-on-failure"
+1 -1
View File
@@ -94,7 +94,7 @@ build-fedora:
before_script:
- dnf update -y
- dnf install -y cmake make gcc diffutils python-unversioned-command
capstone-devel GraphicsMagick SDL2-devel libpng-devel zlib-devel tidy
capstone-devel GraphicsMagick SDL3-devel libpng-devel zlib-devel tidy
python3-gobject gtk3 readline-devel man git rpmdevtools libarchive-devel
script:
- rpmdev-setuptree
+9 -10
View File
@@ -55,8 +55,6 @@ set(ENABLE_DSP_EMU 1
CACHE BOOL "Enable DSP 56k emulator for Falcon mode")
set(ENABLE_TRACING 1
CACHE BOOL "Enable tracing messages for debugging")
set(ENABLE_SDL3 0
CACHE BOOL "Use SDL3 instead of SDL2")
find_path(LIBRETRO_INCLUDE_DIR libretro.h
PATH_SUFFIXES libretro libretro-common)
@@ -123,19 +121,20 @@ endif(ENABLE_OSX_BUNDLE)
# Check for libraries:
# ####################
if(ENABLE_SDL3)
find_package(SDL3)
if(NOT SDL3_FOUND)
message(FATAL_ERROR "SDL3 library not found!")
endif(NOT SDL3_FOUND)
if(NOT DEFINED ENABLE_SDL3 OR ENABLE_SDL3)
find_package(SDL3 QUIET)
endif()
if(SDL3_FOUND)
# Yes, we're cheating by re-using the SDL2_* variables:
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
set(SDL2_LIBRARIES ${SDL3_LIBRARIES})
set(ENABLE_SDL3 1 CACHE BOOL "Use SDL3 instead of SDL2")
else()
find_package(SDL2)
if(NOT SDL2_FOUND)
message(FATAL_ERROR "SDL2 library not found!")
message(FATAL_ERROR "SDL library not found!")
endif(NOT SDL2_FOUND)
set(ENABLE_SDL3 0 CACHE BOOL "Use SDL3 instead of SDL2")
endif()
find_package(Math)
@@ -216,7 +215,7 @@ if(DETECTED_LFS_CFLAGS)
endif(DETECTED_LFS_CFLAGS)
# Additional CFLAGS suggested by the SDL library:
if(NOT ENABLE_SDL3)
if(NOT SDL3_FOUND)
if(PKG_CONFIG_FOUND)
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags-only-other sdl2
OUTPUT_VARIABLE SDL2_OTHER_CFLAGS
@@ -451,7 +450,7 @@ Libraries summary :
-------------------
")
if(ENABLE_SDL3)
if(SDL3_FOUND)
message(" - sdl :\tusing SDL3 ${SDL3_VERSION}")
else()
message(" - sdl :\tusing SDL2 ${SDL2_VERSION}")
Vendored
-7
View File
@@ -17,7 +17,6 @@ print_help()
echo " --enable-asan Enable address sanitizer debug build"
echo " --enable-debug Enable debug (non-optimized) build"
echo " --disable-dsp Disable DSP emulation for Falcon mode."
echo " --enable-sdl3 Use SDL3 instead of SDL2"
echo " --disable-tracing Disable tracing messages for debugging"
echo " --disable-osx-bundle Disable application bundling on macOS"
echo " --enable-ubsan Enable undefined behavior sanitizer debug build"
@@ -65,12 +64,6 @@ do
--disable-dsp)
cmake_args="$cmake_args -DENABLE_DSP_EMU:BOOL=0"
;;
--enable-sdl3)
cmake_args="$cmake_args -DENABLE_SDL3:BOOL=1"
;;
--disable-sdl3)
cmake_args="$cmake_args -DENABLE_SDL3:BOOL=0"
;;
--enable-tracing)
cmake_args="$cmake_args -DENABLE_TRACING:BOOL=1"
;;
+2 -1
View File
@@ -19,7 +19,8 @@ Prefix: /usr
BuildRequires: binutils cmake coreutils cpio cpp diffutils file filesystem
BuildRequires: findutils gcc grep gzip libgcc make man patch sed util-linux
BuildRequires: glibc-devel zlib-devel SDL2-devel libpng-devel readline-devel
BuildRequires: glibc-devel zlib-devel SDL3-devel libpng-devel readline-devel
BuildRequires: libarchive-devel
# Required by zip2st and atari-hd-image
Requires: unzip