fail to build SDL_image with libpng/vendored
1bsyl opened this issue · 10 comments
Any idea, since quite recent change (maybe last 50 commits) ?
if I compile with,
CMAKE_FLAGS+=" -DSDL3IMAGE_VENDORED=ON "
CMAKE_FLAGS+=" -DSDL3IMAGE_BMP=ON "
CMAKE_FLAGS+=" -DSDL3IMAGE_PNG=ON "
CMAKE_FLAGS+=" -DSDL3IMAGE_PNG_SAVE=ON "
CMAKE_FLAGS+=" -DSDL3IMAGE_BACKEND_STB=OFF "
I get this error:
SDL3_image: Using vendored libpng
CMake Deprecation Warning at external/libpng/CMakeLists.txt:33 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at external/libpng/CMakeLists.txt:34 (cmake_policy):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Symbol prefix:
CMake Error at CMakeLists.txt:587 (add_library):
add_library cannot create ALIAS target "PNG::PNG" because target "png" does
not already exist.
CMake Error at CMakeLists.txt:588 (set_property):
set_property could not find TARGET png. Perhaps it has not yet been
created.
CMake Error at CMakeLists.txt:593 (set_target_properties):
set_target_properties Can not find target to add properties to: png
CMake Error at CMakeLists.txt:594 (add_library):
add_library cannot create ALIAS target "SDL3_image::external_libpng"
because target "png" does not already exist.
CMake Error at cmake/PrivateSdlFunctions.cmake:103 (get_target_property):
get_target_property() called with non-existent target "PNG::PNG".
Call Stack (most recent call first):
cmake/PrivateSdlFunctions.cmake:114 (get_actual_target)
CMakeLists.txt:616 (target_get_dynamic_library)
-- Dynamic libpng:
CMake Error at CMakeLists.txt:787 (set_property):
set_property could not find TARGET png. Perhaps it has not yet been
created.
CMake Error at CMakeLists.txt:792 (install):
install TARGETS given target "png" which does not exist.
-- Configuring incomplete, errors occurred!
--> Error: [SDL_image_git] cmake .
Thanks!
thanks, configure now works but I still see an issue when linking:
55%] Linking C shared library libpng16.so
/usr/bin/ld:SDL_image_git_compil/external/libpng/libpng.vers: file format not recognized; treating as linker script
/usr/bin/ld:SDL_image_git_compil/external/libpng/libpng.vers:1: syntax error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [external/libpng/CMakeFiles/png_shared.dir/build.make:373: external/libpng/libpng16.so.16.40.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:825: external/libpng/CMakeFiles/png_shared.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
(I havent investigate at all)
I also saw that error. You need to nuke HAVE_LD_VERSION_SCRIPT
from your cache.
great ! that works thanks a lot !
I think the fixes are eligible for cherry-picking into release-2.8.x branch
Also, for png: libpng master has multiple post-release cmake fixes and updates if we are interested.
Also, for png: libpng master has multiple post-release cmake fixes and updates if we are interested.
We shouldn’t pull prerelease changes from libpng unless they fix critical issues or security patches. If someone needs newer libpng, they can pull it themselves.