office-gobmx/package/Library_package2.mk
Stephan Bergmann 2030e380cf Avoid ODR violation, consistently define ZLIB_CONST
At least my --enable-lto --enable-mergelibs build diagnosed

> [build LNK] Library/libmergedlo.so
> workdir/UnpackedTarball/zlib/zlib.h:86:16: warning: type ‘struct z_stream_s’ violates the C++ One Definition Rule [-Wodr]
>    86 | typedef struct z_stream_s {
>       |                ^
> workdir/UnpackedTarball/zlib/zlib.h:86: note: a different type is defined in another translation unit
>    86 | typedef struct z_stream_s {
>       |
> workdir/UnpackedTarball/zlib/zlib.h:87:20: note: the first difference of corresponding definitions is field ‘next_in’
>    87 |     z_const Bytef *next_in;     /* next input byte */
>       |                    ^
> workdir/UnpackedTarball/zlib/zlib.h:87: note: a field of same name but different type is defined in another translation unit
>    87 |     z_const Bytef *next_in;     /* next input byte */
>       |

(And ZLIB_CONST then required a small adaption in
tools/source/zcodec/zcodec.cxx, plus some loplugin:redundantcast.  And
gb_PrecompiledHeader_ignore_flags_system had to be updated to avoid errors like

> Error reusing pch/inc/pch/precompiled_system by Library_wpftdraw.
>  precompiled header flags : -DBOOST_ALL_NO_LIB -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_MEM_FN_ENABLE_CDECL -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE -DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=msci -DDBG_UTIL -DEXCEPTIONS_ON -DINTEL -DNOMINMAX -DOSL_DEBUG_LEVEL=1 -DPCH_LEVEL=4 -DSAL_LOG_INFO -DSAL_LOG_WARN -DWIN32 -DWNT -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATE -D_DEBUG -D_DLL -D_HAS_AUTO_PTR_ETC -D_MT -D_REENTRANT -D_SCL_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING -D_WIN32_WINNT=0x0601 -D_X86_=1 -EHs -GR -GS -Gd -Gs -Gy -MDd -Od -W4 -Wv:18 -Zc:__cplusplus -Zm500 -bigobj -nologo -permissive- -std:c++17 -utf-8 -wd4127 -wd4201 -wd4244 -wd4250 -wd4251 -wd4267 -wd4275 -wd4505 -wd4611 -wd4706
>             object flags  : -DBOOST_ALL_NO_LIB -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_MEM_FN_ENABLE_CDECL -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE -DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=msci -DDBG_UTIL -DEXCEPTIONS_ON -DINTEL -DNOMINMAX -DOSL_DEBUG_LEVEL=1 -DPCH_LEVEL=4 -DSAL_LOG_INFO -DSAL_LOG_WARN -DWIN32 -DWNT -DZLIB_CONST -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATE -D_DEBUG -D_DLL -D_HAS_AUTO_PTR_ETC -D_MT -D_REENTRANT -D_SCL_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING -D_WIN32_WINNT=0x0601 -D_X86_=1 -EHs -GR -GS -Gd -Gs -Gy -MDd -Od -W4 -Wv:18 -Zc:__cplusplus -Zm500 -bigobj -nologo -permissive- -std:c++17 -utf-8 -wd4127 -wd4201 -wd4244 -wd4250 -wd4251 -wd4267 -wd4275 -wd4505 -wd4611 -wd4706
>  reason :    -DZLIB_CONST -DZLIB_CONST
> Incorrect precompiled header setup or internal gbuild error.
> make[1]: *** [C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/writerperfect/Library_wpftdraw.mk:31: C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/workdir/PrecompiledHeader/nodebug/Timestamps/Library_wpftdraw_reuse] Error 1

with --enable-pch.)

Change-Id: Iadd3c90a65993ebef98190458762b1c86d425c4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119961
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-05 10:04:42 +02:00

80 lines
2.2 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,package2))
$(eval $(call gb_Library_set_componentfile,package2,package/util/package2))
$(eval $(call gb_Library_set_include,package2,\
$$(INCLUDE) \
-I$(SRCDIR)/package/inc \
))
$(eval $(call gb_Library_use_sdk_api,package2))
$(eval $(call gb_Library_add_defs,package2,\
-DDLLIMPLEMENTATION_PACKAGE \
))
$(eval $(call gb_Library_set_precompiled_header,package2,package/inc/pch/precompiled_package2))
$(eval $(call gb_Library_use_libraries,package2,\
comphelper \
cppu \
cppuhelper \
sal \
sax \
salhelper \
ucbhelper \
tl \
utl \
))
$(eval $(call gb_Library_use_externals,package2,\
boost_headers \
zlib \
))
$(eval $(call gb_Library_add_exception_objects,package2,\
package/source/manifest/ManifestExport \
package/source/manifest/ManifestImport \
package/source/manifest/ManifestReader \
package/source/manifest/ManifestWriter \
package/source/zipapi/blowfishcontext \
package/source/zipapi/ByteChucker \
package/source/zipapi/ByteGrabber \
package/source/zipapi/CRC32 \
package/source/zipapi/Deflater \
package/source/zipapi/Inflater \
package/source/zipapi/sha1context \
package/source/zipapi/ThreadedDeflater \
package/source/zipapi/XBufferedThreadedStream \
package/source/zipapi/XUnbufferedStream \
package/source/zipapi/ZipEnumeration \
package/source/zipapi/ZipFile \
package/source/zipapi/ZipOutputEntry \
package/source/zipapi/ZipOutputStream \
package/source/zippackage/wrapstreamforshare \
package/source/zippackage/zipfileaccess \
package/source/zippackage/ZipPackageBuffer \
package/source/zippackage/ZipPackage \
package/source/zippackage/ZipPackageEntry \
package/source/zippackage/ZipPackageFolder \
package/source/zippackage/ZipPackageFolderEnumeration \
package/source/zippackage/ZipPackageSink \
package/source/zippackage/ZipPackageStream \
))
ifneq ($(SYSTEM_ZLIB),)
$(eval $(call gb_Library_add_defs,package2,\
-DSYSTEM_ZLIB \
))
endif
# vim: set noet sw=4 ts=4: