From cf07fa09dc752d1283c22a2df402e7356b770871 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 4 Dec 2023 17:31:18 +0100 Subject: Minor updates of bundled libraries and README.CMake.txt Update Makefiles, CMakeLists.txt, improve formatting. --- png/CMakeLists.txt | 32 +++++++++++++++++--------------- png/Makefile | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'png') diff --git a/png/CMakeLists.txt b/png/CMakeLists.txt index b47323fe4..c61b1a544 100644 --- a/png/CMakeLists.txt +++ b/png/CMakeLists.txt @@ -1,7 +1,7 @@ # # PNG library CMake configuration for the Fast Light Toolkit (FLTK). # -# Copyright 1998-2022 by Bill Spitzak and others. +# Copyright 1998-2023 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -15,7 +15,7 @@ # # source files for png -set(PNG_SRCS +set (PNG_SRCS png.c pngerror.c pngget.c @@ -33,6 +33,13 @@ set(PNG_SRCS pngwutil.c ) +####################################################################### +# Note: This file is used only if we build the bundled PNG library, +# and if we do this we MUST also build and use the *bundled* ZLIB, +# hence we MUST also link against the bundled ZLIB (see below). +# There's no need to check which ZLIB version to use in this context. +####################################################################### + ####################################################################### # Build some files on ARM (e.g. Apple M1 systems) ####################################################################### @@ -43,16 +50,16 @@ set(PNG_SRCS # This includes all non-macOS platforms. if (CMAKE_OSX_ARCHITECTURES) - string(REGEX MATCH "arm64" is_arm "${CMAKE_OSX_ARCHITECTURES}") + string (REGEX MATCH "arm64" is_arm "${CMAKE_OSX_ARCHITECTURES}") else () set (is_arm TRUE) endif () if (is_arm) LIST (APPEND PNG_SRCS - arm/arm_init.c - arm/filter_neon_intrinsics.c - arm/palette_neon_intrinsics.c + arm/arm_init.c + arm/filter_neon_intrinsics.c + arm/palette_neon_intrinsics.c ) endif () @@ -65,8 +72,8 @@ unset (is_arm) ####################################################################### LIST (APPEND PNG_SRCS - powerpc/powerpc_init.c - powerpc/filter_vsx_intrinsics.c + powerpc/powerpc_init.c + powerpc/filter_vsx_intrinsics.c ) ####################################################################### @@ -74,7 +81,7 @@ LIST (APPEND PNG_SRCS ####################################################################### FL_ADD_LIBRARY (fltk_png STATIC "${PNG_SRCS}") -target_link_libraries (fltk_png ${FLTK_ZLIB_LIBRARIES}) +target_link_libraries (fltk_png PUBLIC fltk_z) ####################################################################### # Build the shared library (optional) @@ -83,12 +90,7 @@ target_link_libraries (fltk_png ${FLTK_ZLIB_LIBRARIES}) if (OPTION_BUILD_SHARED_LIBS) FL_ADD_LIBRARY (fltk_png SHARED "${PNG_SRCS}") - - if (FLTK_USE_BUILTIN_ZLIB) - target_link_libraries (fltk_png_SHARED fltk_z) - else() - target_link_libraries (fltk_png_SHARED ${FLTK_ZLIB_LIBRARIES}) - endif () + target_link_libraries (fltk_png_SHARED PUBLIC fltk_z_SHARED) endif () diff --git a/png/Makefile b/png/Makefile index 3326f7a8c..7fd9a8765 100644 --- a/png/Makefile +++ b/png/Makefile @@ -2,7 +2,7 @@ # PNG library Makefile for the Fast Light Toolkit (FLTK). # # Copyright 1997-2011 by Easy Software Products. -# Copyright 2012-2020 by Bill Spitzak and others. +# Copyright 2012-2023 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this -- cgit v1.2.3