diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bf65203..d36298e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ function(ExternalProject_PatchSet TARGET_NAME RESULT) else() set(${RESULT} ${${RESULT}} COMMAND) endif() + set(${RESULT} ${${RESULT}} ${CMAKE_COMMAND} -E echo "Appliying patch ${_PATCH} ..." COMMAND) set(${RESULT} ${${RESULT}} ${PATCH_EXECUTABLE} -p1 < ${_PATCH}) endforeach() if(NOT ${RESULT}) diff --git a/Sources.cmake b/Sources.cmake index 64dfbaa1..387b5ba5 100644 --- a/Sources.cmake +++ b/Sources.cmake @@ -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.12) +set(SDL_VERSION 2.0.14) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 783b6f2df8ff02b19bb5ce492b99c8ff) +set(SDL_MD5 76ed4e6da9c07bd168b2acd9bfefab1b) set(LIBOGG_VERSION 1.3.2) set(LIBOGG_URL http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz) diff --git a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch index 8996042a..45aab2ce 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -11,27 +11,31 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index aa17932b6..3fe76072c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2199,13 +2199,13 @@ endif() +@@ -2196,15 +2196,15 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -# Always build SDLmain +-if(NOT WINDOWS_STORE) -add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -target_include_directories(SDL2main PUBLIC "$" $ $) -set(_INSTALL_LIBS "SDL2main") -if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -endif() +-endif() +# Never build SDLmain ++#if(NOT WINDOWS_STORE) +#add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) +#target_include_directories(SDL2main PUBLIC "$" $) +#set(_INSTALL_LIBS "SDL2main") +#if (NOT ANDROID) +# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) +#endif() - - if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) ++#endif() + + if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") -- 2.14.3 diff --git a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch index 1b97afc2..0c3ea152 100644 --- a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ b/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch @@ -8,11 +8,11 @@ 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 3fe76072c..56cced0f0 100644 +index a420993..ec2cdd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1795,13 +1795,19 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - # set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) +@@ -2206,17 +2206,23 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + #endif() #endif() +file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) @@ -23,6 +23,10 @@ index 3fe76072c..56cced0f0 100644 +endforeach() +list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) + + if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") + endif() + if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) - if(APPLE) @@ -37,7 +41,7 @@ index 3fe76072c..56cced0f0 100644 set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_REVISION} -@@ -1848,7 +1854,9 @@ endif() +@@ -2269,7 +2275,9 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) @@ -48,7 +52,7 @@ index 3fe76072c..56cced0f0 100644 if (NOT SDL_SHARED OR NOT WIN32) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") # Note: Apparently, OUTPUT_NAME must really be unique; even when -@@ -1887,7 +1897,8 @@ endif() +@@ -2311,7 +2319,8 @@ endif() install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}" @@ -57,8 +61,8 @@ index 3fe76072c..56cced0f0 100644 + PUBLIC_HEADER DESTINATION include/SDL2) ##### Export files ##### - if (APPLE) -@@ -1799,23 +1810,15 @@ install( + if (WINDOWS) +@@ -2339,15 +2348,6 @@ install( COMPONENT Devel ) @@ -70,14 +74,14 @@ index 3fe76072c..56cced0f0 100644 -endforeach() -list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) - +- string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) if (UPPER_BUILD_TYPE MATCHES DEBUG) set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") - else() +@@ -2355,7 +2355,7 @@ else() set(SOPOSTFIX "") endif() - + -if(NOT (WINDOWS OR CYGWIN)) +if((NOT WINDOWS OR CYGWIN) AND (NOT BUILD_FRAMEWORK)) if(SDL_SHARED) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index fc91e257..174340ac 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -8,20 +8,20 @@ Subject: [PATCH] CMake: Add MacOSX Framework support 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 56cced0f0..f32165cb7 100644 +index ec2cdd4..c3185d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -373,6 +373,9 @@ dep_option(KMSDRM_SHARED "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF) - option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" "OFF") +@@ -399,6 +399,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal option_string(FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" "OFF") set_option(HIDAPI "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI}) + set_option(JOYSTICK_VIRTUAL "Enable the virtual-joystick driver" ON) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() 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") -@@ -1819,6 +1822,16 @@ if(SDL_SHARED) +@@ -2244,6 +2247,16 @@ if(SDL_SHARED) set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) @@ -35,9 +35,9 @@ index 56cced0f0..f32165cb7 100644 + MACOSX_RPATH ON + OUTPUT_NAME "SDL2") + endif() - target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC "$" $) - if (NOT ANDROID) + target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) + target_include_directories(SDL2 PUBLIC "$" $ $) + if(ANDROID) -- 2.14.3