Skip to content
Merged

SDL3 #47

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/rebuildDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions conan_profiles/base/android
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion conan_profiles/base/apple
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ tools.apple:enable_bitcode=False

[options]
qt/*:openssl=False
sdl_image/*:imageio=True
30 changes: 12 additions & 18 deletions conan_profiles/base/common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion conan_profiles/base/ios
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be fixed in upstream?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. But not on prio list. Would rather spend time on render PR itself.

# SDL's HIDAPI backend calls into libusb, which is not available on iOS and would cause a link error
sdl/*:hidapi=False
5 changes: 5 additions & 0 deletions conan_profiles/base/msvc-intel
Original file line number Diff line number Diff line change
Expand Up @@ -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=[]
Comment thread
Laserlicht marked this conversation as resolved.
3 changes: 0 additions & 3 deletions conan_profiles/msvc-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -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' %}
Expand Down
17 changes: 7 additions & 10 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]",
Comment thread
kambala-decapitator marked this conversation as resolved.
]
_launcherRequires = [
"xz_utils/[^5.2.5]", # innoextract
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down