I was trying to build universal (x86_64 + arm64) Ogre for macOS, but got a link error:
Code: Select all
Undefined symbols for architecture arm64:
"_png_do_expand_palette_rgb8_neon", referenced from:
_png_do_expand_palette in libFreeImage.a(pngrtran.o)
"_png_do_expand_palette_rgba8_neon", referenced from:
_png_do_expand_palette in libFreeImage.a(pngrtran.o)
"_png_riffle_palette_neon", referenced from:
_png_do_read_transformations in libFreeImage.a(pngrtran.o)
So I'm looking in the FreeImage part of the Ogre-Next-deps repo. I don't know much about CMake, but I'm suspicious of this section of the CMakeLists.txt file for FreeImage:
Code: Select all
if( CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR OGRE_BUILD_PLATFORM_APPLE_IOS )
set( FreeImage_SOURCES ${FreeImage_SOURCES}
Source/LibPNG/arm/arm_init.c
Source/LibPNG/arm/filter_neon_intrinsics.c
Source/LibPNG/arm/palette_neon_intrinsics.c
)
else()
set( FreeImage_SOURCES ${FreeImage_SOURCES}
Source/LibPNG/intel/filter_sse2_intrinsics.c
Source/LibPNG/intel/intel_init.c
)
endif()
To my untrained eye, it looks like that's going to use sources for Arm or for Intel, but not both, yet you'd need both to make a universal build. Is my analysis correct, and if so, what might a good fix be?