fix: Upgrade libpng to fix build on new macs (#1507)

This upgrades libpng from v1.6.37 to v1.6.50

This newer libpng doesn't assume the existence of fp.h on Mac (which
isn't present on newer ones), but the CMake options for libpng changed
and had to be adjusted somewhat.
This commit is contained in:
Joey Parrish
2025-11-21 11:13:11 -08:00
committed by GitHub
parent 5776b0b60d
commit 7cd7e48e9c
4 changed files with 8 additions and 6 deletions

View File

@@ -199,6 +199,7 @@ jobs:
fi
cmake \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS="$BUILD_SHARED_LIBS" \
-DFULLY_STATIC="$FULLY_STATIC" \

View File

@@ -42,6 +42,8 @@ add_subdirectory(c-ares EXCLUDE_FROM_ALL)
add_subdirectory(curl EXCLUDE_FROM_ALL)
add_subdirectory(googletest EXCLUDE_FROM_ALL)
add_subdirectory(json EXCLUDE_FROM_ALL)
# NOTE: libpng references zlib, so put zlib before libpng
add_subdirectory(zlib EXCLUDE_FROM_ALL)
add_subdirectory(libpng EXCLUDE_FROM_ALL)
add_subdirectory(libwebm EXCLUDE_FROM_ALL)
add_subdirectory(libxml2 EXCLUDE_FROM_ALL)
@@ -49,4 +51,3 @@ add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
add_subdirectory(mimalloc EXCLUDE_FROM_ALL)
add_subdirectory(mongoose EXCLUDE_FROM_ALL)
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
add_subdirectory(zlib EXCLUDE_FROM_ALL)

View File

@@ -19,12 +19,12 @@ set(PNG_DEBUG OFF)
# Don't install anything.
set(SKIP_INSTALL_ALL ON)
# A confusing name, but this means "let us tell you where to find zlib".
set(PNG_BUILD_ZLIB ON)
# Tell libpng where to find zlib headers.
# Tell libpng where to find zlib.
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/source/")
# Tell libpng where to find zlib library to link to.
set(ZLIB_LIBRARY zlibstatic)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
# Tell libpng where to find libm on Linux (-lm).
set(M_LIBRARY m)