# -*- 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/. #
ifeq ($(gb_FULLDEPS),$(true)) ifneq (,$(CCACHE_HARDLINK)) # cannot move hardlink over itself, so create dep file directly, even if that # might leave a broken file behind in case the build is interrupted forcefully define gb_cxx_dep_generation_options
-MMD -MT $(1) -MP -MF $(2) endef define gb_cxx_dep_copy endef else define gb_cxx_dep_generation_options
-MMD -MT $(1) -MP -MF $(2)_ endef define gb_cxx_dep_copy
&& mv $(1)_ $(1) endef endif else define gb_cxx_dep_generation_options endef define gb_cxx_dep_copy endef endif
ifeq ($(COM_IS_CLANG),TRUE)
gb_PrecompiledHeader_get_enableflags = -include-pch $(call gb_PrecompiledHeader_get_target,$(1),$(2))
gb_PrecompiledHeader_EXT := .pch # Workaround: Apple Clang version 12.0.5 sometimes tries to compile instead of generating PCH # when used just with -c c++-header, so help it by being explicit.
gb_PrecompiledHeader_emit_pch := -Xclang -emit-pch else
gb_PrecompiledHeader_get_enableflags = \
-include $(dir $(call gb_PrecompiledHeader_get_target,$(1),$(2)))$(notdir $(subst .gch,,$(call gb_PrecompiledHeader_get_target,$(1),$(2))))
gb_PrecompiledHeader_EXT := .gch
gb_PrecompiledHeader_emit_pch := endif
# Clang supports building extra object file where it puts code that would be shared by all users of the PCH. # Unlike with MSVC it is built as a separate step. The relevant options are used only when generating the PCH # and when creating the PCH's object file, normal compilations using the PCH do not need extra options.
gb_PrecompiledHeader_pch_with_obj += $(BUILDING_PCH_WITH_OBJ)
gb_PrecompiledHeader_extra_pch_cxxflags += $(BUILDING_PCH_WITH_OBJ) ifneq ($(BUILDING_PCH_WITH_OBJ),) # If using Clang's PCH extra object, we may need to strip unused sections, otherwise inline and template functions # emitted in that object may in some cases cause unresolved references to private symbols in other libraries.
gb_LinkTarget_LDFLAGS += $(LD_GC_SECTIONS)
gb_PrecompiledHeader_pch_with_obj += -ffunction-sections -fdata-sections # Enable generating more shared code and debuginfo in the PCH object file.
gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_DEBUGINFO) ifeq ($(ENABLE_OPTIMIZED),) # -fmodules-codegen appears to be worth it only if not optimizing, otherwise optimizing all the functions emitted # in the PCH object file may take way too long, especially given that many of those may get thrown away
gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_CODEGEN) endif endif
# This is for MSVC's object file built directly as a side-effect of building the PCH.
gb_PrecompiledHeader_get_objectfile =
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.