Skip to content

Commit

Permalink
WIP: Try to update SDL to 2.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed Dec 22, 2024
1 parent eb5616f commit e08c305
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 112 deletions.
4 changes: 2 additions & 2 deletions Sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ set(FREETYPE_VERSION 2.9)
set(FREETYPE_URL http://downloads.sourceforge.net/project/freetype/freetype2/${FREETYPE_VERSION}/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_MD5 d23a1b246e78890458c6672cb45eacd0)

set(SDL_VERSION 2.0.22)
set(SDL_VERSION 2.24.0)
set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_MD5 40aedb499cb2b6f106d909d9d97f869a)
set(SDL_MD5 cf539ffe9e0dd6f943ac9de75fd2e56e)

set(LIBOGG_VERSION 1.3.2)
set(LIBOGG_URL http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz)
Expand Down

This file was deleted.

19 changes: 14 additions & 5 deletions patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ index ec2cdd4..c3185d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -419,6 +419,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal
set_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON)
set_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON)
dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF)
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
+if(APPLE)
+ set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF)
Expand All @@ -35,9 +35,18 @@ index ec2cdd4..c3185d3 100644
+ MACOSX_RPATH ON
+ OUTPUT_NAME "SDL2")
+ endif()
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2 BEFORE PRIVATE "${SDL2_BINARY_DIR}/include")
target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>;$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>;$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>")
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD})
target_include_directories(SDL2 PUBLIC
@@ -3052,7 +3055,7 @@ if(NOT SDL2_DISABLE_INSTALL)
set(SOPOSTFIX "")
endif()

- if(NOT (WINDOWS OR CYGWIN) OR MINGW)
+ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK))
if(SDL_SHARED)
set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
get_target_property(SONAME SDL2 OUTPUT_NAME)
--
2.14.3

9 changes: 5 additions & 4 deletions patches/sdl/0005-CMake-Set-framework-install-directory.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index f32165cb7..50446f868 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2999,6 +2999,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
@@ -3189,6 +3189,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2")
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()

if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
--
2.14.3

0 comments on commit e08c305

Please sign in to comment.