From 99a88af740c425bf250ce9cb2143aa6be3a778f2 Mon Sep 17 00:00:00 2001 From: Tony Zlatinski Date: Tue, 12 Feb 2019 10:50:28 -0600 Subject: [PATCH] cmake: Add support for PNG_ARM_NEON_OPT NDK-r19 On Android, here is clang compiler change for NDKs after ndk-r17c where the compiler intrinsics for libpng are not part of the compiler for the armeabi-v7a targets. Add the supported png functions for these compiler intrinsics, explicitly for 32-bit ARM builds. Affects: dEQP-VK.* Components: Vulkan, Framework VK-GL-CTS issue: 1638 Change-Id: Ib832f983294f5dd747720ed4a79a21e29a06f776 --- external/libpng/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/external/libpng/CMakeLists.txt b/external/libpng/CMakeLists.txt index 7181ba4..d9de774 100644 --- a/external/libpng/CMakeLists.txt +++ b/external/libpng/CMakeLists.txt @@ -39,7 +39,15 @@ set(PNG_SRCS ${PNG_ABS_PATH}/pngpread.c ) -if (DE_CPU_IS_ARM_64) + +if(DE_CPU_IS_ARM AND NOT DEFINED DE_CPU_IS_ARM_NEON) + set(DE_CPU_IS_ARM_NEON 1) + message(STATUS "DE_CPU_IS_ARM_NEON is not defined: Assuming ARM NEON is supported.") +else () + set(DE_CPU_IS_ARM_NEON 0) +endif() + +if (DE_CPU_IS_ARM_64 OR (DE_CPU_IS_ARM AND DE_CPU_IS_ARM_NEON)) # armv8-a has always neon set(PNG_SRCS ${PNG_SRCS} @@ -47,8 +55,12 @@ if (DE_CPU_IS_ARM_64) ${PNG_ABS_PATH}/arm/filter_neon_intrinsics.c ${PNG_ABS_PATH}/arm/filter_neon.S ) +else () + message(STATUS "Disabling ARM NEON optimizations.") + add_definitions(-DPNG_ARM_NEON_OPT=0) endif () + if (DE_DEBUG EQUAL 1) add_definitions(-DPNG_DEBUG) endif () -- 2.7.4