summaryrefslogtreecommitdiff
path: root/png
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-12-04 17:31:18 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-12-04 17:31:18 +0100
commitcf07fa09dc752d1283c22a2df402e7356b770871 (patch)
tree511e5f7dd9de295b23a35172afc0cddc9ce1d13e /png
parenta73a14347db54693fa486e2ebf400d7ce26231e6 (diff)
Minor updates of bundled libraries and README.CMake.txt
Update Makefiles, CMakeLists.txt, improve formatting.
Diffstat (limited to 'png')
-rw-r--r--png/CMakeLists.txt32
-rw-r--r--png/Makefile2
2 files changed, 18 insertions, 16 deletions
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
@@ -34,6 +34,13 @@ set(PNG_SRCS
)
#######################################################################
+# 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