mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 13:07:00 +03:00
For iOS x86_64, do not use dav1d and build aom without optimizations (#8)
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
parent
d042ce3b19
commit
41b83dc0d9
19
.github/workflows/wheels-dependencies.sh
vendored
19
.github/workflows/wheels-dependencies.sh
vendored
|
@ -186,7 +186,7 @@ function build_libavif {
|
|||
|
||||
python3 -m pip install meson ninja
|
||||
|
||||
if [[ "$PLAT" == "x86_64" ]] || [ -n "$SANITIZER" ]; then
|
||||
if ([[ "$PLAT" == "x86_64" ]] && [[ -z "$IOS_SDK" ]]) || [ -n "$SANITIZER" ]; then
|
||||
build_simple nasm 2.16.03 https://www.nasm.us/pub/nasm/releasebuilds/2.16.03
|
||||
fi
|
||||
|
||||
|
@ -196,7 +196,7 @@ function build_libavif {
|
|||
|
||||
local libavif_cmake_flags
|
||||
|
||||
if [ -n "$IS_MACOS" ]; then
|
||||
if [[ -n "$IS_MACOS" ]]; then
|
||||
lto=OFF
|
||||
libavif_cmake_flags=(
|
||||
-DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG -flto" \
|
||||
|
@ -212,6 +212,14 @@ function build_libavif {
|
|||
fi
|
||||
libavif_cmake_flags=(-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now")
|
||||
fi
|
||||
if [[ -n "$IOS_SDK" ]] && [[ "$PLAT" == "x86_64" ]]; then
|
||||
libavif_cmake_flags+=(-DAOM_TARGET_CPU=generic)
|
||||
else
|
||||
libavif_cmake_flags+=(
|
||||
-DAVIF_CODEC_AOM_DECODE=OFF \
|
||||
-DAVIF_CODEC_DAV1D=LOCAL
|
||||
)
|
||||
fi
|
||||
|
||||
local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)
|
||||
|
||||
|
@ -227,8 +235,6 @@ function build_libavif {
|
|||
-DAVIF_LIBYUV=LOCAL \
|
||||
-DAVIF_CODEC_AOM=LOCAL \
|
||||
-DCONFIG_AV1_HIGHBITDEPTH=0 \
|
||||
-DAVIF_CODEC_AOM_DECODE=OFF \
|
||||
-DAVIF_CODEC_DAV1D=LOCAL \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=$lto \
|
||||
-DCMAKE_C_VISIBILITY_PRESET=hidden \
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
|
||||
|
@ -282,12 +288,7 @@ function build {
|
|||
build_tiff
|
||||
fi
|
||||
|
||||
if [[ -z "$IOS_SDK" ]] || [[ "$PLAT" == "arm64" ]]; then
|
||||
# Building libavif for x86_64 iOS simulator isn't currently possible
|
||||
# because it requires the use of nasm, which doesn't create
|
||||
# iOS-compatible binaries.
|
||||
build_libavif
|
||||
fi
|
||||
build_libpng
|
||||
build_lcms2
|
||||
build_openjpeg
|
||||
|
|
|
@ -27,10 +27,6 @@ def test_wheel_modules() -> None:
|
|||
# tkinter is not available on iOS
|
||||
expected_modules.remove("tkinter")
|
||||
|
||||
# libavif is not available on x86_64 iOS simulators
|
||||
if platform.machine() == "x86_64":
|
||||
expected_modules.remove("avif")
|
||||
|
||||
assert set(features.get_supported_modules()) == expected_modules
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user