diff options
author | Cosmin Truta <ctruta@gmail.com> | 2023-12-07 16:11:12 +0200 |
---|---|---|
committer | Cosmin Truta <ctruta@gmail.com> | 2023-12-07 16:11:12 +0200 |
commit | 9c1dc4d13dab823d6441d417546ebeee3994389b (patch) | |
tree | 821727ec75f44b59047fe207b9fcc2049c946161 | |
parent | e755fb79ba945fea8a318dc343e73d22a39e2f4e (diff) | |
download | libpng-9c1dc4d13dab823d6441d417546ebeee3994389b.tar.gz |
cmake: Fix CPU architecture regexes
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ceb9c2a6..12ea26d07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ # Revised by Gunther Nikl, 2023 # Revised by Tyler Kropp, 2023 # Revised by Timothy Lyanguzov, 2023 +# Revised by Clinton Ingram, 2023 # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer @@ -119,10 +120,8 @@ endif() if(PNG_HARDWARE_OPTIMIZATIONS) # Set definitions and sources for ARM. -if(TARGET_ARCH MATCHES "^arm" OR - TARGET_ARCH MATCHES "^aarch64") - if(TARGET_ARCH MATCHES "^arm64" OR - TARGET_ARCH MATCHES "^aarch64") +if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") + if(TARGET_ARCH MATCHES "^(ARM64|arm64|aarch64)") set(PNG_ARM_NEON_POSSIBLE_VALUES on off) set(PNG_ARM_NEON "on" CACHE STRING "Enable ARM NEON optimizations: on|off; on is default") @@ -153,8 +152,7 @@ if(TARGET_ARCH MATCHES "^arm" OR endif() # Set definitions and sources for PowerPC. -if(TARGET_ARCH MATCHES "^powerpc*" OR - TARGET_ARCH MATCHES "^ppc64*") +if(TARGET_ARCH MATCHES "^(powerpc|ppc64)") set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off) set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default") @@ -176,8 +174,7 @@ if(TARGET_ARCH MATCHES "^powerpc*" OR endif() # Set definitions and sources for Intel. -if(TARGET_ARCH MATCHES "^i?86" OR - TARGET_ARCH MATCHES "^x86_64*") +if(TARGET_ARCH MATCHES "^(i[3-6]86|x86_64|AMD64)") set(PNG_INTEL_SSE_POSSIBLE_VALUES on off) set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default") @@ -199,8 +196,7 @@ if(TARGET_ARCH MATCHES "^i?86" OR endif() # Set definitions and sources for MIPS. -if(TARGET_ARCH MATCHES "mipsel*" OR - TARGET_ARCH MATCHES "mips64el*") +if(TARGET_ARCH MATCHES "^mips") set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default") @@ -224,26 +220,22 @@ endif() else(PNG_HARDWARE_OPTIMIZATIONS) # Set definitions and sources for ARM. -if(TARGET_ARCH MATCHES "^arm" OR - TARGET_ARCH MATCHES "^aarch64") +if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") add_definitions(-DPNG_ARM_NEON_OPT=0) endif() # Set definitions and sources for PowerPC. -if(TARGET_ARCH MATCHES "^powerpc*" OR - TARGET_ARCH MATCHES "^ppc64*") +if(TARGET_ARCH MATCHES "^(powerpc|ppc64)") add_definitions(-DPNG_POWERPC_VSX_OPT=0) endif() # Set definitions and sources for Intel. -if(TARGET_ARCH MATCHES "^i?86" OR - TARGET_ARCH MATCHES "^x86_64*") +if(TARGET_ARCH MATCHES "^(i[3-6]86|x86_64|AMD64)") add_definitions(-DPNG_INTEL_SSE_OPT=0) endif() # Set definitions and sources for MIPS. -if(TARGET_ARCH MATCHES "mipsel*" OR - TARGET_ARCH MATCHES "mips64el*") +if(TARGET_ARCH MATCHES "^mips") add_definitions(-DPNG_MIPS_MSA_OPT=0) endif() |