Skip to content

Commit

Permalink
WIP: Try to update SDL to 2.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed Dec 22, 2024
1 parent ea9eb69 commit 658da5b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 23 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.18)
set(SDL_VERSION 2.0.20)
set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_MD5 c1dd33299db5b7091f37d989c68d5212)
set(SDL_MD5 a53acc02e1cca98c4123229069b67c9e)

set(LIBOGG_VERSION 1.3.2)
set(LIBOGG_URL http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz)
Expand Down
46 changes: 42 additions & 4 deletions patches/sdl/0002-Never-build-and-install-SDL2main-library.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] Never build and install SDL2main library
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8209ca..b0a24bc 100644
index f951d0e..81257e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2670,18 +2670,18 @@ endif()
@@ -2747,17 +2747,17 @@ endif()
# Ensure that the extra cflags are used at compile time
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

Expand All @@ -22,7 +22,6 @@ index d8209ca..b0a24bc 100644
- add_library(SDL2::SDL2main ALIAS SDL2main)
- target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include")
- target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>)
- set(_INSTALL_LIBS "SDL2main")
- if (NOT ANDROID)
- set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
- endif()
Expand All @@ -34,14 +33,53 @@ index d8209ca..b0a24bc 100644
+# add_library(SDL2::SDL2main ALIAS SDL2main)
+# target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include")
+# target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>)
+# set(_INSTALL_LIBS "SDL2main")
+# if (NOT ANDROID)
+# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
+# endif()
+#endif()

if(ANDROID)
target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
@@ -2858,12 +2858,12 @@ if(SDL_SHARED)
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()

-if(NOT WINDOWS_STORE)
- install(TARGETS SDL2main EXPORT SDL2mainTargets
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-endif()
+#if(NOT WINDOWS_STORE)
+# install(TARGETS SDL2main EXPORT SDL2mainTargets
+# LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+# ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+# RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+#endif()

if(SDL_STATIC)
install(TARGETS SDL2-static EXPORT SDL2staticTargets
@@ -2893,13 +2893,13 @@ if(SDL_SHARED)
)
endif()

-if(NOT WINDOWS_STORE)
- install(EXPORT SDL2mainTargets
- FILE SDL2mainTargets.cmake
- NAMESPACE SDL2::
- DESTINATION ${PKG_PREFIX}
- )
-endif()
+#if(NOT WINDOWS_STORE)
+# install(EXPORT SDL2mainTargets
+# FILE SDL2mainTargets.cmake
+# NAMESPACE SDL2::
+# DESTINATION ${PKG_PREFIX}
+# )
+#endif()

if(SDL_STATIC)
install(EXPORT SDL2staticTargets
--
2.14.3

Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ index b0a24bc..6a74f12 100644
if (NOT SDL_SHARED OR NOT WIN32 OR MINGW)
set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
# Note: Apparently, OUTPUT_NAME must really be unique; even when
@@ -2780,7 +2789,8 @@ endif()
install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2")
@@ -2855,7 +2855,8 @@ endif()
install(TARGETS SDL2 EXPORT SDL2Targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2")
endif()

##### Export files #####
if (WINDOWS AND NOT MINGW)
#if(NOT WINDOWS_STORE)
@@ -2808,15 +2818,6 @@ install(
COMPONENT Devel
)
Expand Down
2 changes: 1 addition & 1 deletion patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ index ec2cdd4..c3185d3 100644
set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library")
@@ -2731,6 +2734,16 @@ if(SDL_SHARED)
endif()
set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
endif()
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
+ if(APPLE AND BUILD_FRAMEWORK)
+ set_target_properties(SDL2 PROPERTIES
+ FRAMEWORK TRUE
Expand Down
14 changes: 7 additions & 7 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,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index f32165cb7..50446f868 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2686,6 +2686,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")
@@ -2878,6 +2878,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")
endif()

##### Export files #####
--
2.14.3

0 comments on commit 658da5b

Please sign in to comment.