vcpkg/ports/libpng/fix-msa-support-for-mips.patch
Osyotr a469702fe1
[libpng] Update to 1.6.44, add feature tools (#42058)
Co-authored-by: Kai Pastor <dg0yt@darc.de>
2024-11-14 03:10:41 -08:00

29 lines
1.1 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3857b82..4c68989 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,8 +221,8 @@ endif()
# Set definitions and sources for MIPS.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
- set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
- set(PNG_MIPS_MSA "on"
+ set(PNG_MIPS_MSA_POSSIBLE_VALUES on off check)
+ set(PNG_MIPS_MSA "check"
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
set_property(CACHE PNG_MIPS_MSA
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
@@ -254,6 +254,12 @@ if(TARGET_ARCH MATCHES "^(mipsel|mips64el)")
mips/filter_msa_intrinsics.c)
add_definitions(-DPNG_MIPS_MSA_OPT=2)
add_definitions(-DPNG_MIPS_MMI_OPT=0)
+ elseif(PNG_MIPS_MSA STREQUAL "check")
+ set(libpng_mips_sources
+ mips/mips_init.c
+ mips/filter_msa_intrinsics.c)
+ add_definitions(-DPNG_MIPS_MSA_CHECK_SUPPORTED)
+ add_definitions(-DPNG_MIPS_MMI_CHECK_SUPPORTED)
elseif(PNG_MIPS_MMI STREQUAL "on")
set(libpng_mips_sources
mips/mips_init.c