diff --git a/ANNOUNCE b/ANNOUNCE index e6b58744c..7fa38de4b 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1419,6 +1419,7 @@ Version 1.7.0beta85 [December 27, 2016] operation. Version 1.7.0beta86 [December 27, 2016] + Ported CMakeLists.txt from libpng-1.6.27rc01. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 2356250b2..17b3073d1 100644 --- a/CHANGES +++ b/CHANGES @@ -5719,6 +5719,7 @@ Version 1.7.0beta85 [December 27, 2016] operation. Version 1.7.0beta86 [December 27, 2016] + Ported CMakeLists.txt from libpng-1.6.27rc01. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CMakeLists.txt b/CMakeLists.txt index 851ec5d58..fff83ff0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ # Revised by Roger Lowman, 2009-2010 # Revised by Clifford Yapp, 2011-2012 # Revised by Roger Leigh, 2016 +# Revised by Andreas Franek, 2016 # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer @@ -69,6 +70,35 @@ option(PNGARG "Disable ANSI-C prototypes" OFF) set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names") set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings") +# set definitions and sources for arm +if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") + set(PNG_ARM_NEON_POSSIBLE_VALUES check on off) + set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations: + check: (default) use internal checking code; + off: disable the optimizations; + on: turn on unconditionally.") + set_property(CACHE PNG_ARM_NEON PROPERTY STRINGS + ${PNG_ARM_NEON_POSSIBLE_VALUES}) + list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index) + if(index EQUAL -1) + message(FATAL_ERROR + " PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]") + elseif(NOT ${PNG_ARM_NEON} STREQUAL "no") + set(libpng_arm_sources + arm/arm_init.c + arm/filter_neon.S + arm/filter_neon_intrinsics.c) + + if(${PNG_ARM_NEON} STREQUAL "on") + add_definitions(-DPNG_ARM_NEON_OPT=2) + elseif(${PNG_ARM_NEON} STREQUAL "check") + add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED) + endif() + else() + add_definitions(-DPNG_ARM_NEON_OPT=0) + endif() +endif() + # SET LIBNAME set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR}) @@ -360,6 +390,7 @@ set(libpng_sources pngwrite.c pngwtran.c pngwutil.c + ${libpng_arm_sources} ) set(pngtest_sources pngtest.c