Redo "cmake: Fix CPU architecture regexes"

Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Cosmin Truta 2023-12-07 23:17:56 +02:00
parent d65b3ebf00
commit e1088f99d4

View File

@ -27,6 +27,7 @@
# Revised by Gunther Nikl, 2023 # Revised by Gunther Nikl, 2023
# Revised by Tyler Kropp, 2023 # Revised by Tyler Kropp, 2023
# Revised by Timothy Lyanguzov, 2023 # Revised by Timothy Lyanguzov, 2023
# Revised by Clinton Ingram, 2023
# This code is released under the libpng license. # This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer # For conditions of distribution and use, see the disclaimer
@ -119,10 +120,8 @@ endif()
if(PNG_HARDWARE_OPTIMIZATIONS) if(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for ARM. # Set definitions and sources for ARM.
if(TARGET_ARCH MATCHES "^arm" OR if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)")
TARGET_ARCH MATCHES "^aarch64") if(TARGET_ARCH MATCHES "^(ARM64|arm64|aarch64)")
if(TARGET_ARCH MATCHES "^arm64" OR
TARGET_ARCH MATCHES "^aarch64")
set(PNG_ARM_NEON_POSSIBLE_VALUES on off) set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
set(PNG_ARM_NEON "on" set(PNG_ARM_NEON "on"
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default") CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
@ -155,8 +154,7 @@ if(TARGET_ARCH MATCHES "^arm" OR
endif() endif()
# Set definitions and sources for PowerPC. # Set definitions and sources for PowerPC.
if(TARGET_ARCH MATCHES "^powerpc*" OR if(TARGET_ARCH MATCHES "^(powerpc|ppc64)")
TARGET_ARCH MATCHES "^ppc64*")
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off) set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
set(PNG_POWERPC_VSX "on" set(PNG_POWERPC_VSX "on"
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default") CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
@ -178,8 +176,7 @@ if(TARGET_ARCH MATCHES "^powerpc*" OR
endif() endif()
# Set definitions and sources for Intel. # Set definitions and sources for Intel.
if(TARGET_ARCH MATCHES "^i?86" OR if(TARGET_ARCH MATCHES "^(i[3-6]86|x86|AMD64)")
TARGET_ARCH MATCHES "^x86_64*")
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off) set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
set(PNG_INTEL_SSE "on" set(PNG_INTEL_SSE "on"
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default") CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
@ -201,8 +198,7 @@ if(TARGET_ARCH MATCHES "^i?86" OR
endif() endif()
# Set definitions and sources for MIPS. # Set definitions and sources for MIPS.
if(TARGET_ARCH MATCHES "mipsel*" OR if(TARGET_ARCH MATCHES "^(mipsel|mips64el)")
TARGET_ARCH MATCHES "mips64el*")
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
set(PNG_MIPS_MSA "on" set(PNG_MIPS_MSA "on"
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default") CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
@ -226,26 +222,22 @@ endif()
else(PNG_HARDWARE_OPTIMIZATIONS) else(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for ARM. # Set definitions and sources for ARM.
if(TARGET_ARCH MATCHES "^arm" OR if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)")
TARGET_ARCH MATCHES "^aarch64")
add_definitions(-DPNG_ARM_NEON_OPT=0) add_definitions(-DPNG_ARM_NEON_OPT=0)
endif() endif()
# Set definitions and sources for PowerPC. # Set definitions and sources for PowerPC.
if(TARGET_ARCH MATCHES "^powerpc*" OR if(TARGET_ARCH MATCHES "^(powerpc|ppc64)")
TARGET_ARCH MATCHES "^ppc64*")
add_definitions(-DPNG_POWERPC_VSX_OPT=0) add_definitions(-DPNG_POWERPC_VSX_OPT=0)
endif() endif()
# Set definitions and sources for Intel. # Set definitions and sources for Intel.
if(TARGET_ARCH MATCHES "^i?86" OR if(TARGET_ARCH MATCHES "^(i[3-6]86|x86|AMD64)")
TARGET_ARCH MATCHES "^x86_64*")
add_definitions(-DPNG_INTEL_SSE_OPT=0) add_definitions(-DPNG_INTEL_SSE_OPT=0)
endif() endif()
# Set definitions and sources for MIPS. # Set definitions and sources for MIPS.
if(TARGET_ARCH MATCHES "mipsel*" OR if(TARGET_ARCH MATCHES "^(mipsel|mips64el)")
TARGET_ARCH MATCHES "mips64el*")
add_definitions(-DPNG_MIPS_MSA_OPT=0) add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif() endif()