diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dcd6a6..c7a3c16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,11 +35,9 @@ check_symbol_exists(_vsnprintf stdio.h HAVE__VSNPRINTF) # --------------------------------------------------------------------------- # Third-party libraries # --------------------------------------------------------------------------- -# This codebase targets SDL 1.2 and SDL_image 1.2. CMake's bundled FindSDL -# / FindSDL_image modules locate these directly; on macOS with Homebrew, -# `brew install sdl12-compat sdl_image` works. -find_package(SDL REQUIRED) -find_package(SDL_image REQUIRED) +# Migrating to SDL 3. Homebrew: `brew install sdl3 sdl3_image`. +find_package(SDL3 CONFIG REQUIRED) +find_package(SDL3_image CONFIG REQUIRED) if(KOBO_ENABLE_OPENGL) find_package(OpenGL) @@ -122,9 +120,8 @@ target_compile_definitions(kobo_deps INTERFACE target_include_directories(kobo_deps INTERFACE ${CMAKE_CURRENT_BINARY_DIR} # for generated aconfig.h ${CMAKE_CURRENT_SOURCE_DIR} # for config.h - ${SDL_INCLUDE_DIR} ) -target_link_libraries(kobo_deps INTERFACE ${SDL_LIBRARY} ${SDL_IMAGE_LIBRARIES}) +target_link_libraries(kobo_deps INTERFACE SDL3::SDL3 SDL3_image::SDL3_image) if(HAVE_OPENGL) target_compile_definitions(kobo_deps INTERFACE HAVE_OPENGL) diff --git a/graphics/filters.c b/graphics/filters.c index 106041e..f1ae9ff 100644 --- a/graphics/filters.c +++ b/graphics/filters.c @@ -23,7 +23,7 @@ #include #include "logger.h" #include "glSDL.h" -#include "SDL_image.h" +#include #include "sprite.h" #include "filters.h" diff --git a/graphics/gfxengine.cpp b/graphics/gfxengine.cpp index c70a4b1..4016d8e 100644 --- a/graphics/gfxengine.cpp +++ b/graphics/gfxengine.cpp @@ -28,7 +28,7 @@ #include "gfxengine.h" #include "filters.h" -#include "SDL_image.h" +#include #include "glSDL.h" #include "sofont.h" #include "window.h" diff --git a/graphics/glSDL.c b/graphics/glSDL.c index 599a1ff..b43e90b 100644 --- a/graphics/glSDL.c +++ b/graphics/glSDL.c @@ -30,7 +30,7 @@ #include #if HAS_SDL_OPENGL_H -#include "SDL_opengl.h" +#include #else #ifdef WIN32 #include diff --git a/graphics/glSDL.h b/graphics/glSDL.h index 7bdf193..f0bbf4a 100644 --- a/graphics/glSDL.h +++ b/graphics/glSDL.h @@ -20,7 +20,7 @@ */ /* We're still using SDL datatypes here - we just add some stuff. */ -#include "SDL.h" +#include /* * Ignore the flag from SDL w/ glSDL backend, since we're going diff --git a/graphics/sprite.c b/graphics/sprite.c index bb3c582..b1b9eb9 100644 --- a/graphics/sprite.c +++ b/graphics/sprite.c @@ -30,7 +30,7 @@ TODO: tables as needed when loading banks. #include #include "logger.h" #include "glSDL.h" -#include "SDL_image.h" +#include #include "sprite.h" #include "filters.h" diff --git a/sound/audio.c b/sound/audio.c index bbdce24..61f7007 100644 --- a/sound/audio.c +++ b/sound/audio.c @@ -45,8 +45,8 @@ #include "audiodev.h" #endif -#include "SDL.h" -#include "SDL_audio.h" +#include +#include #include "logger.h" #include "a_struct.h"