Skip to content

Commit

Permalink
WIP: Try to update SQL to 2.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed Dec 22, 2024
1 parent 658da5b commit eb5616f
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 141 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ ExternalProject_Add(sdl
-DSDL_DIRECTX=OFF
-DSDL_RENDER_D3D=OFF
-DSDL_VULKAN=OFF
-DSDL2_DISABLE_SDL2MAIN=ON
${SDL_CONFIGURE_FLAGS}
INSTALL_DIR ${SDL_CONFIGURE_INSTALL_DIR}
)
Expand Down
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.20)
set(SDL_VERSION 2.0.22)
set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_MD5 a53acc02e1cca98c4123229069b67c9e)
set(SDL_MD5 40aedb499cb2b6f106d909d9d97f869a)

set(LIBOGG_VERSION 1.3.2)
set(LIBOGG_URL http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ index 8f1e828d1..aa17932b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2848,6 +2848,13 @@ if(NOT (WINDOWS OR CYGWIN))
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
endif()
endif()

+if(SDL_SHARED AND (MSVC_VERSION GREATER 1500) AND (NOT CMAKE_VERSION VERSION_LESS "3.1"))
Expand All @@ -25,7 +25,7 @@ index 8f1e828d1..aa17932b6 100644
+
##### Uninstall target #####

if(NOT TARGET uninstall)
if(NOT SDL2_DISABLE_UNINSTALL)
--
2.14.3

85 changes: 0 additions & 85 deletions patches/sdl/0002-Never-build-and-install-SDL2main-library.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers
1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0a24bc..6a74f12 100644
index 22b91ad..ab0ff17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2683,6 +2683,15 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
# endif()
#endif()
@@ -2874,6 +2874,17 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
endif()
endif()

+file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
+file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
+foreach(_FNAME ${BIN_INCLUDE_FILES})
+ get_filename_component(_INCNAME ${_FNAME} NAME)
+ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
+endforeach()
+list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
+install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
+if(NOT SDL2_DISABLE_INSTALL)
+ file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
+ file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
+ foreach(_FNAME ${BIN_INCLUDE_FILES})
+ get_filename_component(_INCNAME ${_FNAME} NAME)
+ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
+ endforeach()
+ list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
+ install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
+endif()
+
if(ANDROID)
target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
endif()
@@ -2692,14 +2701,12 @@ if(IOS OR TVOS)
@@ -2883,14 +2894,12 @@ if(IOS OR TVOS)
endif()

if(SDL_SHARED)
Expand All @@ -46,7 +48,7 @@ index b0a24bc..6a74f12 100644
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_MAJOR}
@@ -2736,9 +2743,11 @@ endif()
@@ -2929,9 +2938,11 @@ endif()

if(SDL_STATIC)
set (BUILD_SHARED_LIBS FALSE)
Expand All @@ -59,41 +61,41 @@ 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
@@ -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()
@@ -2974,7 +2985,8 @@ if(NOT SDL2_DISABLE_INSTALL)
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()

#if(NOT WINDOWS_STORE)
@@ -2808,15 +2818,6 @@ install(
COMPONENT Devel
)
if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
@@ -3036,15 +3048,6 @@ if(NOT SDL2_DISABLE_INSTALL)
COMPONENT Devel
)

-file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
-file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
-foreach(_FNAME ${BIN_INCLUDE_FILES})
- get_filename_component(_INCNAME ${_FNAME} NAME)
- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
-endforeach()
-list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
-install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
- file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
- file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
- foreach(_FNAME ${BIN_INCLUDE_FILES})
- get_filename_component(_INCNAME ${_FNAME} NAME)
- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
- endforeach()
- list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
- install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
-
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
if (UPPER_BUILD_TYPE MATCHES DEBUG)
set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
@@ -2824,7 +2825,7 @@ else()
set(SOPOSTFIX "")
endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
if (UPPER_BUILD_TYPE MATCHES DEBUG)
set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
@@ -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)
- 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

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,13 +11,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index f32165cb7..50446f868 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
@@ -2999,6 +2999,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()

--
2.14.3
Expand Down

0 comments on commit eb5616f

Please sign in to comment.