Skip to content

Commit

Permalink
deps(PNG): disable Framework build for libpng
Browse files Browse the repository at this point in the history
*This* seems to be the key we were looking for...

Also, it looks like libpng 1.6.44 (released less than a week ago) generates a proper CMake config, so prefer that if it's available....

Signed-off-by: Zach Lewis <[email protected]>
  • Loading branch information
zachlewis committed Sep 17, 2024
1 parent 0160971 commit 35210f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/cmake/build_PNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# PNG by hand!
######################################################################

set_cache (PNG_BUILD_VERSION 1.6.43 "PNG version for local builds")
set_cache (PNG_BUILD_VERSION 1.6.44 "PNG version for local builds")
set (PNG_GIT_REPOSITORY "https://github.com/glennrp/libpng")
set (PNG_GIT_TAG "v${PNG_BUILD_VERSION}")

set_cache (PNG_BUILD_SHARED_LIBS ON #${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
set_cache (PNG_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
DOC "Should execute a local PNG build, if necessary, build shared libraries" ADVANCED)

string (MAKE_C_IDENTIFIER ${PNG_BUILD_VERSION} PNG_VERSION_IDENT)
Expand All @@ -23,6 +23,7 @@ build_dependency_with_cmake(PNG
-D PNG_SHARED=${PNG_BUILD_SHARED_LIBS}
-D PNG_EXECUTABLES=OFF
-D PNG_TESTS=OFF
-D PNG_FRAMEWORK=OFF
-D CMAKE_POSITION_INDEPENDENT_CODE=ON
-D CMAKE_INSTALL_LIBDIR=lib
)
Expand All @@ -33,6 +34,10 @@ set (PNG_DIR ${PNG_LOCAL_INSTALL_DIR})
# Signal to caller that we need to find again at the installed location
set (PNG_REFIND TRUE)
set (PNG_REFIND_VERSION ${PNG_BUILD_VERSION})
if ({$PNG_BUILD_VERSION} VERSION_GREATER_EQUAL "1.6.44")
# CMake configs added in libpng 1.6.44
set (PNG_REFIND_ARGS CONFIG)
endif ()

if (PNG_BUILD_SHARED_LIBS)
install_local_dependency_libs (PNG PNG)
Expand Down
5 changes: 4 additions & 1 deletion src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ endif ()
# Dependencies for optional formats and features. If these are not found,
# we will continue building, but the related functionality will be disabled.

checked_find_package (PNG VERSION_MIN 1.6.0)
checked_find_package (PNG
VERSION_MIN 1.6.0
PREFER_CONFIG # Config added in 1.6.44
)

checked_find_package (BZip2) # Used by ffmpeg and freetype
if (NOT BZIP2_FOUND)
Expand Down

0 comments on commit 35210f1

Please sign in to comment.