aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2022-05-01 13:03:49 +1000
committerGitHub <noreply@github.com>2022-05-01 13:03:49 +1000
commit3ff502b3dd23aba36285c1170647c275a72e78cd (patch)
tree477b1cb55481e42642b0b5cccde4ee5b6fb671a4
parentbd9c153b93075e8eb558954155cf82bd66ffcab5 (diff)
parent615afd3f4f55c678f5994c9c3091e1321a14e138 (diff)
Merge pull request #21336 from fuzzard/depends_libpngfix
[tools/depends][target] libpng disable hardware call for apple aarch64 targets
-rw-r--r--tools/depends/target/libpng/Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/depends/target/libpng/Makefile b/tools/depends/target/libpng/Makefile
index 4e4def73bc..934ab4cce2 100644
--- a/tools/depends/target/libpng/Makefile
+++ b/tools/depends/target/libpng/Makefile
@@ -7,17 +7,20 @@ CMAKE_OPTIONS=-DPNG_SHARED=OFF \
-DPNG_TESTS=OFF \
-DPNG_DEBUG=OFF
-ifneq ($(findstring apple-darwin, $(HOST)), apple-darwin)
+ifeq ($(findstring apple-darwin, $(HOST)), apple-darwin)
+ # hardware optimizations require NEON instructions that
+ # fail on m1 hardware and ios/tvos, so just disable for any arm64 target cpu on
+ # an apple-darwin target
+ ifeq ($(CPU), arm64)
+ CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=OFF
+ else
+ CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON
+ endif
+else
CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON \
-DPNG_BUILD_ZLIB=ON \
-DZLIB_LIBRARY=$(PREFIX)/lib/libz.a \
-DZLIB_INCLUDE_DIR=$(PREFIX)/include
-else
- ifeq ($(OS), osx)
- CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON
- else
- CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=OFF
- endif
endif
LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT)