Include ARM files in ext/libpng17/CMakeLists.txt for ARM processors

Needed when building atlas/zimtool.It fixes this error:
```
/usr/bin/ld: png17/libpng17.a(pngrutil.c.o): in function `png_read_process_IDAT':
pngrutil.c:(.text+0x548c): undefined reference to `png_init_filter_functions_neon'                                                            collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/zimtool.dir/build.make:134: build/zimtool] Error 1
make[1]: *** [CMakeFiles/Makefile2:128: CMakeFiles/zimtool.dir/all] Error 2                                                                   make[1]: *** Waiting for unfinished jobs....
```
This commit is contained in:
santiago046 2024-04-26 17:31:27 -03:00 committed by GitHub
parent adaa9fbbb4
commit 31bf179879
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 3.8)
project(libpng17)
add_library(png17 add_library(png17 STATIC
pngconf.h pngconf.h
pngdebug.h pngdebug.h
png.c png.c
@ -18,9 +19,24 @@ add_library(png17
pngrutil.c pngrutil.c
pngset.c pngset.c
pngstruct.h pngstruct.h
pngtest.c
pngtrans.c pngtrans.c
pngwio.c pngwio.c
pngwrite.c pngwrite.c
pngwtran.c pngwtran.c
pngwutil.c) pngwutil.c
)
# Add arm files for ARM processors
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm(64)?|aarch64")
set (ARM_FILES arm/arm_init.c
)
# Check if it's 32 bit
if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4)
list(APPEND ARM_FILES arm/filter_neon.S)
else()
list(APPEND ARM_FILES arm/filter_neon_intrinsics.c)
endif()
target_sources(png17 PRIVATE ${ARM_FILES})
endif()