diff --git a/.github/workflows/rebuildDependencies.yml b/.github/workflows/rebuildDependencies.yml index 5672f8e..aada3db 100644 --- a/.github/workflows/rebuildDependencies.yml +++ b/.github/workflows/rebuildDependencies.yml @@ -94,6 +94,14 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Select Android SDK platform for Qt + if: ${{ startsWith(matrix.platform, 'android') }} + run: | + # Qt 5 can't handle minor-versioned SDK platforms (e.g. android-37.2): + # it picks such a platform as the newest one and then fails to find android.jar in it + androidPlatform=$(ls "$ANDROID_HOME/platforms" | grep -E '^android-[[:digit:]]+$' | sort --version-sort | tail -n1) + echo "ANDROID_API_VERSION=$androidPlatform" >> "$GITHUB_ENV" + - name: Setup Conan Client run: | pipx install conan diff --git a/conan_profiles/base/android b/conan_profiles/base/android index 73e68db..417082f 100644 --- a/conan_profiles/base/android +++ b/conan_profiles/base/android @@ -16,6 +16,9 @@ os=Android # https://github.com/conan-io/conan/issues/16468#issuecomment-2175877245 tools.meson.mesontoolchain:extra_machine_files={{ [os.path.join(profile_dir, "meson_workaround.txt")] }} +# SDL v3 recipe refuses to build for Android without this acknowledgement +user.sdl:android=True + [options] # TODO https://github.com/conan-io/conan-center-index/issues/26020 # freetype/*:shared=True diff --git a/conan_profiles/base/apple b/conan_profiles/base/apple index 204fdc7..f7ae815 100644 --- a/conan_profiles/base/apple +++ b/conan_profiles/base/apple @@ -19,4 +19,3 @@ tools.apple:enable_bitcode=False [options] qt/*:openssl=False -sdl_image/*:imageio=True diff --git a/conan_profiles/base/common b/conan_profiles/base/common index f2ab24d..c7620da 100644 --- a/conan_profiles/base/common +++ b/conan_profiles/base/common @@ -204,34 +204,28 @@ qt/*:with_openal=False qt/*:with_pq=False # SDL -sdl/*:iconv=True -sdl/*:sdl2main=True -sdl/*:vulkan=False +sdl/*:libiconv=True # SDL_image # bmp, png are the only ones that needs to be supported # dds support may be useful for HD edition, but not supported by sdl_image at the moment -sdl_image/*:gif=False -sdl_image/*:lbm=False -sdl_image/*:pcx=False -sdl_image/*:pnm=False -sdl_image/*:qoi=False -sdl_image/*:svg=False -sdl_image/*:tga=False +sdl_image/*:with_avif=False +sdl_image/*:with_jxl=False sdl_image/*:with_libjpeg=False sdl_image/*:with_libtiff=False sdl_image/*:with_libwebp=False -sdl_image/*:xcf=False -sdl_image/*:xpm=False -sdl_image/*:xv=False # SDL_mixer # mp3, ogg and wav are the only ones that needs to be supported, flac is a bonus -sdl_mixer/*:mad=False -sdl_mixer/*:mikmod=False -sdl_mixer/*:modplug=False -sdl_mixer/*:nativemidi=False -sdl_mixer/*:tinymidi=False +sdl_mixer/*:with_flac=flac +sdl_mixer/*:with_mpg123=True +sdl_mixer/*:with_opus=True +sdl_mixer/*:with_vorbis=stb + +# SDL_ttf +sdl_ttf/*:with_harfbuzz=False +# plutosvg is needed for color emoji support +sdl_ttf/*:with_plutosvg=True # libsquish # accelerate as much as possible diff --git a/conan_profiles/base/ios b/conan_profiles/base/ios index 1f2230a..6a69f73 100644 --- a/conan_profiles/base/ios +++ b/conan_profiles/base/ios @@ -12,4 +12,9 @@ sdl_mixer/*:shared=False sdl_ttf/*:shared=False qt/*:opengl=es2 -sdl/*:sdl2main=False + +# desktop OpenGL is unavailable here anyway and the recipe would produce a broken +# package_info(): it references opengl::opengl without requiring it +sdl/*:opengl=False +# SDL's HIDAPI backend calls into libusb, which is not available on iOS and would cause a link error +sdl/*:hidapi=False diff --git a/conan_profiles/base/msvc-intel b/conan_profiles/base/msvc-intel index bf5e2b2..6d3045d 100644 --- a/conan_profiles/base/msvc-intel +++ b/conan_profiles/base/msvc-intel @@ -15,3 +15,8 @@ compiler.version=192 _WIN32_WINNT_WIN7, NTDDI_WIN7, ) }} + +# SDL v3 must be compiled against the newest SDK headers (e.g. WASAPI uses fields that +# don't exist with the Win7 NTDDI_VERSION targeted here), it checks the OS version at +# runtime instead. Profiles targeting Windows 10 headers (e.g. msvc-arm64) are unaffected +sdl/*:tools.build:defines=[] diff --git a/conan_profiles/msvc-arm64 b/conan_profiles/msvc-arm64 index 83d79b9..251dfd0 100644 --- a/conan_profiles/msvc-arm64 +++ b/conan_profiles/msvc-arm64 @@ -6,9 +6,6 @@ include(base/msvc) arch=armv8 [conf] -# workaround for https://github.com/libsdl-org/SDL/issues/13254 -sdl/*:tools.cmake.cmaketoolchain:extra_variables={'SDL_LIBC': 'ON'} - # Windows 10 1709 "Redstone 3" {% set _WIN32_WINNT_WIN10 = '0x0A00' %} {% set NTDDI_WIN10_RS3 = '0x0A000004' %} diff --git a/conanfile.py b/conanfile.py index 391312b..ec4d07c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,7 +6,8 @@ from os import getenv from pathlib import Path -required_conan_version = ">=2.13.0" +# sdl_mixer recipe requires >=2.25 +required_conan_version = ">=2.25.0" class VCMI(ConanFile): settings = "os", "compiler", "build_type", "arch" @@ -19,9 +20,9 @@ class VCMI(ConanFile): _clientRequires = [ "libsquish/[^1.15]", "onetbb/[^2021.7]", - "sdl_image/[^2.8.2]", - "sdl_mixer/[^2.8.0]", - "sdl_ttf/[^2.0.18]", + "sdl_image/[^3.4.4]", + "sdl_mixer/[^3.2.0]", + "sdl_ttf/[^3.2.2]", ] _launcherRequires = [ "xz_utils/[^5.2.5]", # innoextract @@ -80,8 +81,6 @@ def config_options(self): # hard requirements on dependencies' options def configure(self): - self.options["sdl"].sdl2main = self.settings.os != "iOS" - self.options["qt"].qttools = True self.options["qt"].with_md4c = True if self.settings.os == "Android": @@ -129,10 +128,8 @@ def requirements(self): self.requires("fmt/[>=12.1.0]") self.requires("glaze/[>=5.5.4]") - # upcoming SDL version 3.0+ is not supported at the moment due to API breakage - # SDL versions between 2.22-2.26.1 have broken sound - # versions before 2.30.7 don't build for Android with NDK 27: https://github.com/libsdl-org/SDL/issues/9792 - self.requires("sdl/[^2.30.7]") + # sdl_mixer requires SDL 3.4+ + self.requires("sdl/[^3.4.0]") # launcher if self.settings.os == "Android":