Author: truckman Date: Sat Aug 27 18:17:29 2016 New Revision: 1758061 URL: http://svn.apache.org/viewvc?rev=1758061&view=rev Log: #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. Modified: openoffice/trunk/main/solenv/gbuild/LinkTarget.mk Modified: openoffice/trunk/main/solenv/gbuild/LinkTarget.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/gbuild/LinkTarget.mk?rev=1758061&r1=1758060&r2=1758061&view=diff ============================================================================== --- openoffice/trunk/main/solenv/gbuild/LinkTarget.mk (original) +++ openoffice/trunk/main/solenv/gbuild/LinkTarget.mk Sat Aug 27 18:17:29 2016 @@ -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