diff --git a/.github/workflows/android-macos-python.yml b/.github/workflows/android-macos-python.yml index 881da017..115e26b3 100644 --- a/.github/workflows/android-macos-python.yml +++ b/.github/workflows/android-macos-python.yml @@ -15,7 +15,7 @@ on: jobs: build-android: name: ${{ matrix.ndk-arch }} on ${{ matrix.arch }} Android - runs-on: macos-11 + runs-on: macos-13 strategy: matrix: ndk-arch: [x86_64] @@ -150,13 +150,13 @@ jobs: pushd build-boost/Boost-for-Android/libiconv-libicu-android/${{ matrix.ndk-arch }}/ zip -r -9 -q ../../../../FreeOrionSDK_${{ steps.cmake-dist-version.outputs.dist-version }}_Android-${{ matrix.ndk-arch }}.zip lib/libicui18n.a lib/libicuuc.a lib/libicudata.a lib/libiconv.so - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: Artifacts if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: - name: python SDK + name: python ${{ matrix.ndk-arch }} SDK path: | - python39.zip + ${{ matrix.ndk-arch == 'x86_64' && 'python39.zip' || '' }} FreeOrionSDK_${{ steps.cmake-dist-version.outputs.dist-version }}_Android-${{ matrix.ndk-arch }}.zip - name: Prepare Release diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 42fb0ddf..781f5fd4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-11] + os: [macos-13] env: CMAKE_BUILD_PARALLEL_LEVEL: 2 HOMEBREW_NO_AUTO_UPDATE: 1 @@ -21,14 +21,14 @@ jobs: run: | mkdir build cd build - xcversion select 11.7 + xcodes select 14.1 cmake -DCMAKE_XCODE_BUILD_SYSTEM=1 .. - name: Build run: | cd build cmake --build . --config RelWithDebInfo - name: Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: name: MacOS SDK diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7bf4d746..e1f0fec6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,10 +32,10 @@ jobs: cd build cmake --build . --config RelWithDebInfo -- /verbosity:d - name: Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: - name: Windows SDK + name: Windows ${{ matrix.toolset }}-${{ matrix.arch }} SDK path: | build/FreeOrionSDK_*_MSVC-${{ matrix.toolset }}-${{ matrix.arch }}.zip - name: Prepare Release diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a91fab7..1115756e 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}) @@ -373,9 +374,9 @@ if(WIN32) else() set(SDL_CONFIGURE_FLAGS -DBUILD_SHARED_LIBS=ON - -DBUILD_FRAMEWORK=ON + -DBUILD_FRAMEWORK=OFF ) - set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}/Frameworks) + set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}) endif() ExternalProject_PatchSet(sdl SDL_PATCHSET) @@ -393,9 +394,10 @@ ExternalProject_Add(sdl -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_} -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} -DSDL_STATIC=OFF - -DDIRECTX=OFF - -DRENDER_D3D=OFF - -DVIDEO_VULKAN=OFF + -DSDL_DIRECTX=OFF + -DSDL_RENDER_D3D=OFF + -DSDL_VULKAN=OFF + -DSDL2_DISABLE_SDL2MAIN=ON ${SDL_CONFIGURE_FLAGS} INSTALL_DIR ${SDL_CONFIGURE_INSTALL_DIR} ) @@ -555,7 +557,7 @@ else() list(GET _VS_PLATFORM_TOOLSET 0 _VS_PLATFORM_TOOLSET_VERSION) list(GET _VS_PLATFORM_TOOLSET 1 _VS_PLATFORM_TOOLSET_TARGET) math(EXPR _VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}/10") - set(_VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}.0") + set(_VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}.3") set(BOOST_CONFIGURE_FLAGS debug-store=database ) @@ -570,6 +572,7 @@ else() list(APPEND BOOST_CONFIGURE_FLAGS define=BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_VISTA) endif() set(BOOST_TOOLSET msvc-${_VS_PLATFORM_TOOLSET_VERSION}) + message(STATUS "Boost toolset is msvc-${_VS_PLATFORM_TOOLSET_VERSION} for ${CMAKE_VS_PLATFORM_TOOLSET}") set(BOOST_OSX_SYSROOT "") endif() diff --git a/Sources.cmake b/Sources.cmake index 165785d2..5b87b33f 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.26.0) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 783b6f2df8ff02b19bb5ce492b99c8ff) +set(SDL_MD5 35bc58cfe41b8fb6c8e6646be26fa47e) 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/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch index f632d9ee..9122ba09 100644 --- a/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch +++ b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch @@ -12,8 +12,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f1e828d1..aa17932b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1947,6 +1947,13 @@ if(NOT (WINDOWS OR CYGWIN)) - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal") +@@ -2848,6 +2848,13 @@ if(NOT (WINDOWS OR CYGWIN)) + endif() endif() +if(SDL_SHARED AND (MSVC_VERSION GREATER 1500) AND (NOT CMAKE_VERSION VERSION_LESS "3.1")) @@ -25,7 +25,7 @@ index 8f1e828d1..aa17932b6 100644 + ##### Uninstall target ##### - if(NOT TARGET uninstall) + if(NOT SDL2_DISABLE_UNINSTALL) -- 2.14.3 diff --git a/patches/sdl/0002-CMake-Remove-so-names.patch b/patches/sdl/0002-CMake-Remove-so-names.patch new file mode 100644 index 00000000..e1184328 --- /dev/null +++ b/patches/sdl/0002-CMake-Remove-so-names.patch @@ -0,0 +1,36 @@ +From b9cfc3565b4d56adc5f022a5ab18c89959bc9476 Mon Sep 17 00:00:00 2001 +From: O01eg +Date: Wed, 25 Dec 2024 10:40:02 +0400 +Subject: [PATCH 2/2] CMake: Remove so-names + +--- + CMakeLists.txt | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a596eec..b509bb3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3290,9 +3290,7 @@ if(SDL_SHARED) + if(APPLE) + # FIXME: Remove SOVERSION in SDL3 + set_target_properties(SDL2 PROPERTIES +- MACOSX_RPATH 1 +- SOVERSION 0 +- OUTPUT_NAME "SDL2-${LT_RELEASE}") ++ MACOSX_RPATH 1) + elseif(UNIX AND NOT ANDROID) + set_target_properties(SDL2 PROPERTIES + VERSION ${LT_VERSION} +@@ -3518,7 +3516,7 @@ if(NOT SDL2_DISABLE_INSTALL) + install(FILES ${SDL2_BINARY_DIR}/sdl2.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() +- if(NOT (WINDOWS OR CYGWIN) OR MINGW) ++ if(NOT (WINDOWS OR CYGWIN OR APPLE) OR MINGW) + if(SDL_SHARED) + set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. + get_target_property(SONAME SDL2 OUTPUT_NAME) +-- +2.45.2 + diff --git a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch deleted file mode 100644 index 8996042a..00000000 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b8b84a04806f077a341a6014ae71ce0ac9d182ad Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:23:05 +0200 -Subject: [PATCH] Never build and install SDL2main library - ---- - CMakeLists.txt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa17932b6..3fe76072c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2199,13 +2199,13 @@ endif() - # Ensure that the extra cflags are used at compile time - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - --# Always build SDLmain --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() -+# Never build SDLmain -+#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}) --- -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 deleted file mode 100644 index 1b97afc2..00000000 --- a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 8a05500c8ad7b72f38ca3ff67116b1e2e4d61afa Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:51:35 +0200 -Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers - ---- - CMakeLists.txt | 34 ++++++++++++++++++---------------- - 1 file changed, 18 insertions(+), 16 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3fe76072c..56cced0f0 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}) - #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}) -+ - if(SDL_SHARED) -- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) -- if(APPLE) -- set_target_properties(SDL2 PROPERTIES -- MACOSX_RPATH 1 -- OUTPUT_NAME "SDL2-${LT_RELEASE}") -- elseif(UNIX AND NOT ANDROID) -+ add_library(SDL2 SHARED ${INCLUDE_FILES} ${SOURCE_FILES} ${VERSION_SOURCES}) -+ set_target_properties(SDL2 PROPERTIES -+ PUBLIC_HEADER "${INCLUDE_FILES}") -+ if(UNIX AND NOT ANDROID) - set_target_properties(SDL2 PROPERTIES - VERSION ${LT_VERSION} - SOVERSION ${LT_REVISION} -@@ -1848,7 +1854,9 @@ endif() - - if(SDL_STATIC) - set (BUILD_SHARED_LIBS FALSE) -- add_library(SDL2-static STATIC ${SOURCE_FILES}) -+ add_library(SDL2-static STATIC ${INCLUDE_FILES} ${SOURCE_FILES}) -+ set_target_properties(SDL2-static PROPERTIES -+ PUBLIC_HEADER "${INCLUDE_FILES}") - 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() - install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" -- RUNTIME DESTINATION bin) -+ RUNTIME DESTINATION bin -+ PUBLIC_HEADER DESTINATION include/SDL2) - - ##### Export files ##### - if (APPLE) -@@ -1799,23 +1810,15 @@ 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 include/SDL2) - - string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) - if (UPPER_BUILD_TYPE MATCHES DEBUG) - set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") - else() - set(SOPOSTFIX "") - endif() - --if(NOT (WINDOWS OR CYGWIN)) -+if((NOT WINDOWS OR CYGWIN) 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 - diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch deleted file mode 100644 index fc91e257..00000000 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 43524a3266a76d091e41c4aca86e009fd06bae9d Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:10:19 +0200 -Subject: [PATCH] CMake: Add MacOSX Framework support - ---- - CMakeLists.txt | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 56cced0f0..f32165cb7 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") - 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}) -+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) - 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 -+ FRAMEWORK_VERSION ${SDL_VERSION} -+ MACOSX_FRAMEWORK_IDENTIFIER org.libsdl.SDL2 -+ MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${SDL_VERSION} -+ MACOSX_FRAMEWORK_BUNDLE_VERSION ${SDL_VERSION} -+ MACOSX_RPATH ON -+ OUTPUT_NAME "SDL2") -+ endif() - target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC "$" $) - if (NOT ANDROID) --- -2.14.3 - diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch deleted file mode 100644 index c21ffb8c..00000000 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 4243d36624b0ab5bf80c3ab9c0269e419a4beb09 Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:58:04 +0200 -Subject: [PATCH] CMake: Set framework install directory - ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f32165cb7..50446f868 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1793,6 +1793,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" - RUNTIME DESTINATION bin -+ FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} - PUBLIC_HEADER DESTINATION include/SDL2) - - ##### Export files ##### --- -2.14.3 -