[Libreoffice-commits] core.git: Branch 'aoo/trunk' - solenv/gbuild

Don Lewis truckman at apache.org
Sat Aug 27 20:08:15 UTC 2016


 solenv/gbuild/LinkTarget.mk |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9ebe53ffa5e53bd40917de9db539f63abb32a634
Author: Don Lewis <truckman at apache.org>
Date:   Sat Aug 27 18:17:29 2016 +0000

    #i117845#  [gbuild] invalid link-target dep-files can be generated
    
    Fix the Windows build performance regression with precompiled headers
    introduced by the fix for #i117845# that was merged from
    branches/gbuild-reintegration by r1755455.
    
    The use of precompiled headers is triggered by the use of two compiler
    flags, -DPRECOMPILED_HEADERS which triggers the inclusion of a special
    header for the library that includes all of the include files needed
    for any source file in the library, and -Yu[headername] which tells the
    the Microsoft compiler to use the precompiled version of this header.
    
    It would be nice if these two flags were added to the compiler flags
    at the same time, but they are not.  The -DPRECOMPILED_HEADERS flag
    is always added if the library is configured to use precompiled
    headers, but the -Yu flag is only added conditionally if the flags
    for building  a particular source file match those that were used to
    precompile the header.  A further condition is the presence of
    $(PCH_NAME), which is set as a target-specific variable on the
    library, and which is supposed to be inherited by its dependencies
    to be used when compiling the source files for the library.
    Unfortunately the fix for #i117845 caused the source and object
    files to be dependencies of a different target, which did not
    have $(PCH_NAME) set.  They did not inherit $(PCH_NAME), so they
    were compiled with -DPRECOMPILED_HEADERS, but not -Yu, causing the
    compiler to do more work than in the case where the precompiled
    header option is disabled resulting in longer builds with the  use
    of this option.
    
    Fix by setting a target-specific $(PCH_NAME) for the new target.

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 0190683..b875846 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -725,6 +725,7 @@ ifeq ($(gb_FULLDEPS),$(true))
 	$(call gb_PrecompiledHeader_get_dep_target,$(3)) \
 	$(call gb_NoexPrecompiledHeader_get_dep_target,$(3))
 $(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(DEFS) -DPRECOMPILED_HEADERS
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_NAME := $(3)
 $(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS = $$(DEFS)
 endif
 


More information about the Libreoffice-commits mailing list