office-gobmx/external/libtommath/ExternalProject_libtommath.mk
Stephan Bergmann dae5dc8d89 external/libtommath: Avoid -Wsystem-headers warnings/errors
NO_ADDTL_WARNINGS controls whether
workdir/UnpackedTarball/libtommath/makefile.include adds -Wsystem-headers (among
others) to CFLAGS, which has generally been harmless as we build that external
code with warnings not as errors.  But Clang 12 trunk <https://github.com/llvm/
llvm-project/commit/f47b8851318d5ec2fa1e7867f3fdb86101cdc1da> "[clang] Enable
errors for undefined TARGET_OS_ macros in Darwin driver" now unconditionally
added some -Werror=... on Darwin/macOS that would cause the build to fail with

> In file included from bncore.c:1:
> In file included from ./tommath_private.h:18:
> In file included from ./tommath.h:25:
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:220:5: error: 'TARGET_OS_EMBEDDED' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
> #if TARGET_OS_EMBEDDED
>     ^

at least with Xcode 11.6.

Change-Id: I5465b9070ff60da85b9278b0e46dcf6c801fbda6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-21 09:20:01 +02:00

38 lines
1.1 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_ExternalProject_ExternalProject,libtommath))
$(eval $(call gb_ExternalProject_register_targets,libtommath,\
build \
))
$(eval $(call gb_ExternalProject_use_nmake,libtommath,build))
ifeq ($(COM),MSC)
$(call gb_ExternalProject_get_state_target,libtommath,build):
$(call gb_Trace_StartRange,libtommath,EXTERNAL)
$(call gb_ExternalProject_run,build,\
nmake -nologo -f makefile.msvc \
)
$(call gb_Trace_EndRange,libtommath,EXTERNAL)
else
$(call gb_ExternalProject_get_state_target,libtommath,build) :
$(call gb_Trace_StartRange,libtommath,EXTERNAL)
$(call gb_ExternalProject_run,build,\
unset MAKEFLAGS \
&& export CFLAGS=" \
-fPIC \
" \
&& $(MAKE) $(if $(verbose),V=1) NO_ADDTL_WARNINGS=1 \
)
$(call gb_Trace_EndRange,libtommath,EXTERNAL)
endif
# vim: set noet sw=4 ts=4: