Update git submodules
[LibreOffice.git] / external / libpng / StaticLibrary_libpng.mk
blob6f07750c55ebe1c7a634dfc630a0f24a495acc8c
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_StaticLibrary_StaticLibrary,libpng))
12 $(eval $(call gb_StaticLibrary_set_warnings_disabled,libpng))
14 $(eval $(call gb_StaticLibrary_use_unpacked,libpng,libpng))
16 $(eval $(call gb_StaticLibrary_use_externals,libpng,\
17 zlib \
20 $(eval $(call gb_StaticLibrary_add_generated_cobjects,libpng,\
21 UnpackedTarball/libpng/png \
22 UnpackedTarball/libpng/pngerror \
23 UnpackedTarball/libpng/pngget \
24 UnpackedTarball/libpng/pngmem \
25 UnpackedTarball/libpng/pngpread \
26 UnpackedTarball/libpng/pngread \
27 UnpackedTarball/libpng/pngrio \
28 UnpackedTarball/libpng/pngrtran \
29 UnpackedTarball/libpng/pngrutil \
30 UnpackedTarball/libpng/pngset \
31 UnpackedTarball/libpng/pngtrans \
32 UnpackedTarball/libpng/pngwio \
33 UnpackedTarball/libpng/pngwrite \
34 UnpackedTarball/libpng/pngwtran \
35 UnpackedTarball/libpng/pngwutil \
36 $(if $(filter ARM AARCH64,$(CPUNAME)),\
37 UnpackedTarball/libpng/arm/arm_init \
38 UnpackedTarball/libpng/arm/filter_neon_intrinsics \
39 UnpackedTarball/libpng/arm/palette_neon_intrinsics \
40 ) \
41 $(if $(filter POWERPC POWERPC64,$(CPUNAME)), \
42 UnpackedTarball/libpng/powerpc/powerpc_init \
43 UnpackedTarball/libpng/powerpc/filter_vsx_intrinsics \
44 ) \
45 $(if $(filter INTEL X86_64,$(CPUNAME)), \
46 UnpackedTarball/libpng/intel/intel_init \
47 UnpackedTarball/libpng/intel/filter_sse2_intrinsics \
48 ) \
51 $(eval $(call gb_StaticLibrary_add_defs,libpng,\
52 $(if $(filter ARM AARCH64,$(CPUNAME)), -DPNG_ARM_NEON) \
53 $(if $(filter POWERPC POWERPC64,$(CPUNAME)), -DPNG_POWERPC_VSX ) \
54 $(if $(filter INTEL X86_64,$(CPUNAME)), -DPNG_INTEL_SSE_OPT) \
57 # At least on Linux, with --enable-lto, when building both this external/libpng and external/skia,
58 # and building with GCC but building skia with Clang (which should be the sole combination that
59 # matches "LO_CLANG_CC is non-empty"), build this as a fat archive (including both the intermediate GCC
60 # object code for LTO and machine object code). Besides targets like Library_vcl (which benefit
61 # from the intermediate GCC object code for LTO), also Library_skia (built with the Clang toolchain
62 # lld, which does not understand intermediate GCC object code) includes this, so would otherwise
63 # fail to link (but now does not benefit from LTO for this included StaticLibrary_libpng):
64 ifeq ($(OS)-$(ENABLE_LTO),LINUX-TRUE)
65 ifneq ($(filter SKIA,$(BUILD_TYPE)),)
66 ifneq ($(LO_CLANG_CC),)
67 $(eval $(call gb_StaticLibrary_add_cflags,libpng,-ffat-lto-objects))
68 endif
69 endif
70 endif
72 # vim: set noet sw=4 ts=4: