Skip to content

Commit

Permalink
COMP: Add ARM sources to libpng build
Browse files Browse the repository at this point in the history
This compilation of the function identified in the name mangling header
addresses linker errors with the Apple Silicon ARM64 system following
their requirement in the logic at:

  https://github.com/InsightSoftwareConsortium/ITK/blob/1e0755ce4ceb79823157f68ed1c6db317df2679d/Modules/ThirdParty/PNG/src/itkpng/pngpriv.h#L160-L165
  • Loading branch information
thewtex authored and dzenanz committed Jan 18, 2021
1 parent 5a0e6db commit 3199260
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/ThirdParty/PNG/src/itkpng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ pngerror.c pngpread.c pngrutil.c pngwutil.c
pngread.c pngset.c pngwio.c
)

if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
list(APPEND PNG_SRCS
arm/arm_init.c
arm/filter_neon_intrinsics.c
arm/palette_neon_intrinsics.c)
endif()

if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DPNG_BUILD_DLL)
Expand Down
4 changes: 4 additions & 0 deletions Modules/ThirdParty/PNG/src/itkpng/itk_png_mangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ nm lib/libitkpng-4.12.a 2> /dev/null | grep " T \| D \| R " |
#define png_destroy_write_struct itk_png_destroy_write_struct
#define png_do_bgr itk_png_do_bgr
#define png_do_check_palette_indexes itk_png_do_check_palette_indexes
#define png_do_expand_palette_rgb8_neon itk_png_do_expand_palette_rgb8_neon
#define png_do_expand_palette_rgba8_neon itk_png_do_expand_palette_rgba8_neon
#define png_do_invert itk_png_do_invert
#define png_do_packswap itk_png_do_packswap
#define png_do_read_interlace itk_png_do_read_interlace
Expand Down Expand Up @@ -208,6 +210,7 @@ nm lib/libitkpng-4.12.a 2> /dev/null | grep " T \| D \| R " |
#define png_image_write_to_memory itk_png_image_write_to_memory
#define png_image_write_to_stdio itk_png_image_write_to_stdio
#define png_info_init_3 itk_png_info_init_3
#define png_init_filter_functions_neon itk_png_init_filter_functions_neon
#define png_init_io itk_png_init_io
#define png_init_read_transformations itk_png_init_read_transformations
#define png_longjmp itk_png_longjmp
Expand Down Expand Up @@ -259,6 +262,7 @@ nm lib/libitkpng-4.12.a 2> /dev/null | grep " T \| D \| R " |
#define png_reciprocal2 itk_png_reciprocal2
#define png_reset_crc itk_png_reset_crc
#define png_reset_zstream itk_png_reset_zstream
#define png_riffle_palette_neon itk_png_riffle_palette_neon
#define png_sRGB_base itk_png_sRGB_base
#define png_sRGB_delta itk_png_sRGB_delta
#define png_sRGB_table itk_png_sRGB_table
Expand Down

0 comments on commit 3199260

Please sign in to comment.