mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 13:54:46 +08:00
[sdl2] Update to 2.0.16 (#19509)
* [sdl2] Update to 2.0.16 * [sdl2] Update version files * [sdl2] Fix uwp builds * [sdl2] Update version files * [sdl2] Change version-semver to version * [sdl2] Fix uwp pkgconfig file creation * [sdl2] Add alias on static build * [sdl2] Remove cmake wrapper * [sdl2] Update version files * [sdl2] Disable SDL2::SDL2main target search on uwp * [sdl2] Update version files Co-authored-by: Rémy Tassoux <rt2@rasterizedworld.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
parent
c721ff6784
commit
25382e39f7
@ -1,22 +1,31 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -2086,7 +2086,6 @@
|
||||
@@ -2348,7 +2348,6 @@
|
||||
execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh
|
||||
WORKING_DIRECTORY ${SDL2_BINARY_DIR})
|
||||
endif()
|
||||
-if(NOT WINDOWS OR CYGWIN)
|
||||
-if(NOT WINDOWS OR CYGWIN OR MINGW)
|
||||
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
|
||||
@@ -2129,7 +2129,6 @@
|
||||
|
||||
@@ -2375,7 +2375,7 @@
|
||||
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
||||
listtostrrev(SDL_LIBS _SDL_LIBS)
|
||||
set(SDL_LIBS ${_SDL_LIBS})
|
||||
- else()
|
||||
+ elseif(NOT WINDOWS_STORE)
|
||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
||||
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
||||
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
||||
@@ -2403,7 +2403,6 @@
|
||||
"${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
|
||||
configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in"
|
||||
"${SDL2_BINARY_DIR}/SDL2.spec" @ONLY)
|
||||
-endif()
|
||||
|
||||
##### Info output #####
|
||||
message(STATUS "")
|
||||
@@ -2376,6 +2376,7 @@
|
||||
macro(check_add_debug_flag FLAG SUFFIX)
|
||||
check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX})
|
||||
@@ -2728,6 +2728,7 @@
|
||||
# TODO: what about the .spec file? Is it only needed for RPM creation?
|
||||
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal")
|
||||
endif()
|
||||
|
@ -1,8 +1,6 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 06aa026..81d7645 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1240,12 +1240,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
|
||||
@@ -1295,12 +1295,6 @@
|
||||
set(HAVE_FCITX TRUE)
|
||||
endif()
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
--- a/SDL2Config.cmake
|
||||
+++ b/SDL2Config.cmake
|
||||
@@ -32,6 +2,7 @@
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
+if(NOT WINDOWS_STORE)
|
||||
foreach(prop ${relprops})
|
||||
get_target_property(sdl2mainimplib SDL2::SDL2main ${prop})
|
||||
if(sdl2mainimplib)
|
||||
@@ -37,6 +37,7 @@
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
+endif()
|
||||
|
||||
foreach(prop ${dbgprops})
|
||||
get_target_property(sdl2implibdbg SDL2::SDL2 ${prop})
|
||||
@@ -47,6 +47,7 @@
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
+if(NOT WINDOWS_STORE)
|
||||
foreach(prop ${dbgprops})
|
||||
get_target_property(sdl2mainimplibdbg SDL2::SDL2main ${prop})
|
||||
if(sdl2mainimplibdbg)
|
||||
@@ -55,6 +55,7 @@
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
+endif()
|
||||
|
||||
if( sdl2implib AND sdl2mainimplib AND sdl2implibdbg AND sdl2mainimplibdbg )
|
||||
# we have both release and debug builds of SDL2 and SDL2main, so use this ugly
|
@ -1,25 +0,0 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1395,8 +1395,13 @@
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+ if(WINDOWS_STORE)
|
||||
+ file(GLOB WINRT_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp)
|
||||
+ set(SOURCE_FILES ${SOURCE_FILES} ${WINRT_MISC_SOURCES})
|
||||
+ else()
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/windows/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
|
||||
+ endif()
|
||||
set(HAVE_SDL_MISC TRUE)
|
||||
|
||||
# Check for DirectX
|
||||
@@ -1522,7 +1522,7 @@
|
||||
set(HAVE_SDL_THREADS TRUE)
|
||||
endif()
|
||||
|
||||
- if(SDL_SENSOR AND HAVE_SENSORSAPI_H)
|
||||
+ if(SDL_SENSOR AND HAVE_SENSORSAPI_H AND NOT WINDOWS_STORE)
|
||||
set(SDL_SENSOR_WINDOWS 1)
|
||||
set(HAVE_SDL_SENSORS TRUE)
|
||||
file(GLOB WINDOWS_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/windows/*.c)
|
17
ports/sdl2/0004-sdl2-alias-on-static-build.patch
Normal file
17
ports/sdl2/0004-sdl2-alias-on-static-build.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- a/SDL2Config.cmake
|
||||
+++ b/SDL2Config.cmake
|
||||
@@ -2,5 +2,14 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
|
||||
|
||||
+# on static-only builds create an alias
|
||||
+if(NOT TARGET SDL2::SDL2 AND TARGET SDL2::SDL2-static)
|
||||
+ if(CMAKE_VERSION VERSION_LESS "3.18")
|
||||
+ # Aliasing local targets is not supported on CMake < 3.18, so make it global.
|
||||
+ set_target_properties(SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
+ endif()
|
||||
+ add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
|
||||
+endif()
|
||||
+
|
||||
# provide ${SDL2_LIBRARIES}, ${SDL2_INCLUDE_DIRS} etc, like sdl2-config.cmake does,
|
||||
# for compatibility between SDL2 built with autotools and SDL2 built with CMake
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
|
||||
--- a/cmake/sdlchecks.cmake
|
||||
+++ b/cmake/sdlchecks.cmake
|
||||
@@ -847,7 +847,7 @@ macro(CheckPTHREAD)
|
||||
# Run some tests
|
||||
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
|
||||
- if(CMAKE_CROSSCOMPILING)
|
||||
+ if(CMAKE_CROSSCOMPILING OR DARWIN)
|
||||
set(HAVE_PTHREADS 1)
|
||||
else()
|
||||
check_c_source_runs("
|
@ -1,18 +1,15 @@
|
||||
set(SDL2_VERSION 2.0.14)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz"
|
||||
FILENAME "SDL2-${SDL2_VERSION}.tar.gz"
|
||||
SHA512 ebc482585bd565bf3003fbcedd91058b2183e333b9ea566d2f386da0298ff970645d9d25c1aa4459c7c96e9ea839fd1c5f2da0242a56892865b2e456cdd027ee
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
set(SDL2_VERSION 2.0.16)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REPO libsdl-org/SDL
|
||||
REF release-2.0.16
|
||||
SHA512 45ce71f77b01f5fd886f92e5b3d96f1f72c7e0f70c09e615384a900533b941cad65bf6b54a125a9eeb8499e2056e9a8e54d4e654bccfca9730584792a2b18fbc
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0001-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch
|
||||
0002-sdl2-skip-ibus-on-linux.patch
|
||||
0003-sdl2-fix-uwp-build.patch
|
||||
0004-sdl2-macos-thread-detection-fix.patch
|
||||
0003-sdl2-disable-sdlmain-target-search-on-uwp.patch
|
||||
0004-sdl2-alias-on-static-build.patch
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)
|
||||
@ -77,8 +74,7 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|
||||
configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)")
|
||||
|
@ -1,8 +0,0 @@
|
||||
_find_package(${ARGS})
|
||||
if(TARGET SDL2::SDL2 AND NOT TARGET SDL2::SDL2-static)
|
||||
add_library( SDL2::SDL2-static INTERFACE IMPORTED)
|
||||
set_target_properties(SDL2::SDL2-static PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2")
|
||||
elseif(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
|
||||
add_library( SDL2::SDL2 INTERFACE IMPORTED)
|
||||
set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static")
|
||||
endif()
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "sdl2",
|
||||
"version-string": "2.0.14",
|
||||
"port-version": 4,
|
||||
"version": "2.0.16",
|
||||
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
|
||||
"homepage": "https://www.libsdl.org/download-2.0.php",
|
||||
"features": {
|
||||
|
@ -5765,8 +5765,8 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"sdl2": {
|
||||
"baseline": "2.0.14",
|
||||
"port-version": 4
|
||||
"baseline": "2.0.16",
|
||||
"port-version": 0
|
||||
},
|
||||
"sdl2-gfx": {
|
||||
"baseline": "1.0.4",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "66a51e068567b3b76ebb844ba7b4336abc7c35ce",
|
||||
"version": "2.0.16",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "44061d4f51d8cba5625da7b41ef712976d9416e8",
|
||||
"version-string": "2.0.14",
|
||||
|
Loading…
x
Reference in New Issue
Block a user