Skip to content

Commit 5bfe39e

Browse files
committed
For iOS x86_64, do not use dav1d and build aom without optimizations
1 parent d042ce3 commit 5bfe39e

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.github/workflows/wheels-dependencies.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function build_libavif {
186186

187187
python3 -m pip install meson ninja
188188

189-
if [[ "$PLAT" == "x86_64" ]] || [ -n "$SANITIZER" ]; then
189+
if ([[ "$PLAT" == "x86_64" ]] && [[ -z "$IOS_SDK" ]]) || [ -n "$SANITIZER" ]; then
190190
build_simple nasm 2.16.03 https://www.nasm.us/pub/nasm/releasebuilds/2.16.03
191191
fi
192192

@@ -196,7 +196,7 @@ function build_libavif {
196196

197197
local libavif_cmake_flags
198198

199-
if [ -n "$IS_MACOS" ]; then
199+
if [[ -n "$IS_MACOS" ]]; then
200200
lto=OFF
201201
libavif_cmake_flags=(
202202
-DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG -flto" \
@@ -212,6 +212,14 @@ function build_libavif {
212212
fi
213213
libavif_cmake_flags=(-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now")
214214
fi
215+
if [[ -n "$IOS_SDK" ]] && [[ "$PLAT" == "x86_64" ]]; then
216+
libavif_cmake_flags+=(-DAOM_TARGET_CPU=generic)
217+
else
218+
libavif_cmake_flags+=(
219+
-DAVIF_CODEC_AOM_DECODE=OFF \
220+
-DAVIF_CODEC_DAV1D=LOCAL
221+
)
222+
fi
215223

216224
local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)
217225

@@ -227,8 +235,6 @@ function build_libavif {
227235
-DAVIF_LIBYUV=LOCAL \
228236
-DAVIF_CODEC_AOM=LOCAL \
229237
-DCONFIG_AV1_HIGHBITDEPTH=0 \
230-
-DAVIF_CODEC_AOM_DECODE=OFF \
231-
-DAVIF_CODEC_DAV1D=LOCAL \
232238
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=$lto \
233239
-DCMAKE_C_VISIBILITY_PRESET=hidden \
234240
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
@@ -282,12 +288,7 @@ function build {
282288
build_tiff
283289
fi
284290

285-
if [[ -z "$IOS_SDK" ]] || [[ "$PLAT" == "arm64" ]]; then
286-
# Building libavif for x86_64 iOS simulator isn't currently possible
287-
# because it requires the use of nasm, which doesn't create
288-
# iOS-compatible binaries.
289-
build_libavif
290-
fi
291+
build_libavif
291292
build_libpng
292293
build_lcms2
293294
build_openjpeg

checks/check_wheel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ def test_wheel_modules() -> None:
2727
# tkinter is not available on iOS
2828
expected_modules.remove("tkinter")
2929

30-
# libavif is not available on x86_64 iOS simulators
31-
if platform.machine() == "x86_64":
32-
expected_modules.remove("avif")
33-
3430
assert set(features.get_supported_modules()) == expected_modules
3531

3632

0 commit comments

Comments
 (0)