* Feature: Properly detect ARM32/ARM64 in the CMake build process and enable ARM NEON when either of these are detected.

This commit is contained in:
Robert MacGregor 2021-10-27 17:30:43 -04:00
parent 69216b706a
commit 6b56210a47
2 changed files with 22 additions and 9 deletions

View file

@ -24,13 +24,17 @@ project(lpng)
# addDef(PNG_NO_ASSEMBLER_CODE)
# Issues with Neon at the moment (Arm support)
# https://sourceforge.net/p/libpng/bugs/281/
set(PNG_ARM_NEON off CACHE STRING "")
add_definitions(-DPNG_ARM_NEON_OPT=0)
# Enables NEON for libpng
if ( TORQUE_CPU_ARM32 OR TORQUE_CPU_ARM64 )
set(PNG_INTEL_NEON on CACHE STRING "")
add_definitions(-DPNG_ARM_NEON_OPT=1)
addPath("${libDir}/lpng/arm")
else()
set(PNG_ARM_NEON off CACHE STRING "")
add_definitions(-DPNG_ARM_NEON_OPT=0)
endif()
# Enables SSE for libpng - also takes care of compiler warnings.
# If we don't want SSE, we should set it to off/0.
if ( TORQUE_CPU_X32 OR TORQUE_CPU_X64 )
set(PNG_INTEL_SSE on CACHE STRING "")
add_definitions(-DPNG_INTEL_SSE_OPT=1)