From 023974c3db72f503ac2654c047be5bcad77286a7 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 20 Mar 2023 07:17:54 +0100 Subject: [PATCH] [libpng] Fix arm neon (#30226) --- ports/libpng/portfile.cmake | 12 ++++++++---- ports/libpng/vcpkg.json | 6 ++++++ versions/baseline.json | 2 +- versions/l-/libpng.json | 5 +++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 4e43b88e83..d4628ac097 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_minimum_required(VERSION 2022-09-15) # for ${VERSION} - # Download the apng patch set(LIBPNG_APNG_PATCH_PATH "") set(LIBPNG_APNG_OPTION "") @@ -56,8 +54,14 @@ vcpkg_list(SET LD_VERSION_SCRIPT_OPTION) if(VCPKG_TARGET_IS_ANDROID) vcpkg_list(APPEND LD_VERSION_SCRIPT_OPTION "-Dld-version-script=OFF") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - # for armeabi-v7a, check whether NEON is available - vcpkg_list(APPEND LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_ARM_NEON=check") + vcpkg_cmake_get_vars(cmake_vars_file) + include("${cmake_vars_file}") + if(VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON) + vcpkg_list(APPEND LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_ARM_NEON=on") + else() + # for armeabi-v7a, check whether NEON is available + vcpkg_list(APPEND LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_ARM_NEON=check") + endif() endif() endif() diff --git a/ports/libpng/vcpkg.json b/ports/libpng/vcpkg.json index f3c59862f0..a5fb4f90be 100644 --- a/ports/libpng/vcpkg.json +++ b/ports/libpng/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libpng", "version": "1.6.39", + "port-version": 1, "description": "libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files", "homepage": "https://github.com/glennrp/libpng", "license": "libpng-2.0", @@ -13,6 +14,11 @@ "name": "vcpkg-cmake-config", "host": true }, + { + "name": "vcpkg-cmake-get-vars", + "host": true, + "platform": "arm & android" + }, "zlib" ], "features": { diff --git a/versions/baseline.json b/versions/baseline.json index 5b87df5f57..fe06eb957e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4294,7 +4294,7 @@ }, "libpng": { "baseline": "1.6.39", - "port-version": 0 + "port-version": 1 }, "libpopt": { "baseline": "1.16", diff --git a/versions/l-/libpng.json b/versions/l-/libpng.json index 903cc58aeb..55b6f9c284 100644 --- a/versions/l-/libpng.json +++ b/versions/l-/libpng.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "af144fe56e6e4c08cd8089d2e1dd46bae60a5062", + "version": "1.6.39", + "port-version": 1 + }, { "git-tree": "5418b205ed842ffdcd4d65c07f43087e0afcf3f3", "version": "1.6.39",