# -*- 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/. #
# If CC or CXX already include -fvisibility=hidden, don't duplicate it ifeq (,$(filter -fvisibility=hidden,$(CC)))
gb_VISIBILITY_FLAGS := -fvisibility=hidden endif
gb_VISIBILITY_FLAGS_CXX := -fvisibility-inlines-hidden
gb_CXXFLAGS_COMMON += $(gb_VISIBILITY_FLAGS_CXX)
ifneq ($(gb_ENABLE_PCH),) ifeq ($(COM_IS_CLANG),TRUE) # Clang by default includes in the PCH timestamps of the files it was # generated from, which would make the PCH be a "new" file for ccache # even if the file has not actually changed. Disabling the timestamp # prevents this at the cost of risking using an outdated PCH (which # should be unlikely, given that gbuild has dependencies set up # for our includes and system includes are unlikely to change).
gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp else
gb_CFLAGS_COMMON += -fpch-preprocess -Winvalid-pch
gb_CXXFLAGS_COMMON += -fpch-preprocess -Winvalid-pch
gb_NO_PCH_TIMESTAMP := endif endif
gb_CFLAGS_WERROR = $(if $(ENABLE_WERROR),-Werror)
# This is the default in non-C++11 mode ifeq ($(COM_IS_CLANG),TRUE)
gb_CXX03FLAGS := -std=gnu++98 -Werror=c++11-extensions -Wno-c++11-long-long \
-Wno-deprecated-declarations else
gb_CXX03FLAGS := -std=gnu++98 -Wno-long-long \
-Wno-variadic-macros -Wno-deprecated-declarations endif
ifeq ($(ENABLE_LTO),TRUE) ifeq ($(COM_IS_CLANG),TRUE)
gb_LTOFLAGS := -flto=thin ifeq (,$(index,iOS MACOSX,$(OS)))
gb_LTOPLUGINFLAGS := --plugin $(if $(LD_PLUGIN),$(LD_PLUGIN),LLVMgold.so) endif else # use parallelism based on make's job handling
gb_LTOFLAGS := -flto=jobserver -fuse-linker-plugin -O2 # clang does not support -flto=<number>
gb_CLANG_LTOFLAGS := -flto=thin endif endif
gb_LinkTarget_EXCEPTIONFLAGS := \
-fexceptions
ifeq ($(ENABLE_DBGUTIL),) # Clang doesn't have this option ifeq ($(HAVE_GCC_FNO_ENFORCE_EH_SPECS),TRUE)
gb_LinkTarget_EXCEPTIONFLAGS += \
-fno-enforce-eh-specs
gb_FilterOutClangCFLAGS += -fno-enforce-eh-specs endif endif
# We turn on and off this one depending on whether icecream and/or ccache are used, # and changing cxxflags cause PCH rebuilds, so e.g. a plain temporary 'CCACHE_DISABLE=1' # would cause a rebuild. Ignore the flag there, it's irrelevant for PCH use anyway.
gb_PrecompiledHeader_ignore_flags_for_flags_file := -Wunused-macros
ifeq ($(OS),ANDROID)
gb_DEBUGINFO_FLAGS=-glldb # Clang does not know -ggdb2 or some other options elseifeq ($(HAVE_GCC_GGDB2),TRUE)
gb_DEBUGINFO_FLAGS=-ggdb2 else
gb_DEBUGINFO_FLAGS=-g2 endif
gb_LINKER_DEBUGINFO_FLAGS=
ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
gb_DEBUGINFO_FLAGS+=-gsplit-dwarf # GCC 11 defaults to -gdwarf-5, which GDB 10 doesn't support in split debug info ifeq ($(COM_IS_CLANG),)
gb_DEBUGINFO_FLAGS+=-gdwarf-4 endif endif
# Set CCACHE_CPP2=1 to prevent Clang generating spurious warnings.
# For Emscripten, the emcc command is a Python script that outputs annoying warnings like # .../emscripten/tools/building.py:638: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/emscripten_temp_0fvvg__1/conftest.js.jso.js' mode='w' encoding='utf-8'> # into stderr, which makes a configure script think that there is a problem in # compiling even a microscopic test program with an option like -Werror which # surely *is* supported. Avoid this by setting PYTHONWARNINGS=ignore.
gb_COMPILER_SETUP += CCACHE_CPP2=1 $(if $(filter EMSCRIPTEN,$(OS)),PYTHONWARNINGS=ignore)
gb_COMPILER_PLUGINS_SETUP := ICECC_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox CCACHE_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox SCCACHE_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox
gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \
-Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors else # Set CCACHE_CPP2 to prevent GCC -Werror=implicit-fallthrough= when ccache strips comments from C # code (which still needs /*fallthrough*/-style comments to silence that warning): ifeq ($(ENABLE_WERROR),TRUE)
gb_COMPILER_SETUP += CCACHE_CPP2=1 endif
gb_COMPILER_TEST_FLAGS :=
gb_COMPILER_PLUGINS :=
gb_COMPILER_PLUGINS_TOOL :=
gb_COMPILER_PLUGINS_SETUP :=
gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := endif
# Executable class
gb_Executable_EXT_for_build :=
# Helper class
ifeq ($(OS_FOR_BUILD),MACOSX)
gb_Helper_LIBRARY_PATH_VAR := DYLD_LIBRARY_PATH elseifeq ($(OS_FOR_BUILD),WNT) # In theory possible if cross-compiling to some Unix from Windows, # in practice strongly discouraged to even try that
gb_Helper_LIBRARY_PATH_VAR := PATH elseifeq ($(OS_FOR_BUILD),HAIKU)
gb_Helper_LIBRARY_PATH_VAR := LIBRARY_PATH else
gb_Helper_LIBRARY_PATH_VAR := LD_LIBRARY_PATH endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.