Kaydet (Commit) be6227b6 authored tarafından Luboš Luňák's avatar Luboš Luňák

try to get a good checksum for CCACHE_PCH_EXTSUM also with gcc

Its PCHs are always different even if the source is the same (timestamps
somewhere?). But if the output of gcc -E for that precompiled header
source is the same, then technically the .gch should be without a change.
So this makes ccache get hits even if the .gch gets rebuilt, as long
as ccache is new enough to support CCACHE_PCH_EXTSUM (3.5+).

Change-Id: I447bb4840047f23deed55e25de1794047a0a9998
Reviewed-on: https://gerrit.libreoffice.org/72705
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 065299f7
......@@ -42,7 +42,7 @@ $(call gb_PrecompiledHeader_get_dep_target,$(1),$(2)) :
$(call gb_PrecompiledHeader_get_target,$(1),$(2)) :
rm -f $$@
$$(call gb_PrecompiledHeader__command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) $$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(2))
$(SHA256SUM) $$@ >$$@.sum
$$(call gb_PrecompiledHeader__sum_command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) $$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(2))
ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$$(call var2file,$$(shell $$(gb_MKTEMP)),200,$$(call gb_PrecompiledHeader_get_dep_target_tmp,$(1),$(2))) && \
......
......@@ -110,6 +110,32 @@ $(call gb_Helper_abbreviate_dirs,\
)
endef
ifeq ($(COM_IS_CLANG),TRUE)
# Clang has -fno-pch-timestamp, just checksum the file for CCACHE_PCH_EXTSUM
define gb_PrecompiledHeader__sum_command
$(SHA256SUM) $(1) >$(1).sum
endef
else
# GCC does not generate the same .gch for the same input, so checksum the (preprocessed) input
define gb_PrecompiledHeader__sum_command
$(call gb_Helper_abbreviate_dirs,\
CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \
$(gb_CXX) \
-x c++-header \
$(4) $(5) \
$(gb_COMPILERDEPFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
$(gb_NO_PCH_TIMESTAMP) \
$(6) \
-E $(patsubst %.cxx,%.hxx,$(3)) \
-o- \
| $(SHA256SUM) >$(1).sum \
)
endef
endif
# YaccTarget class
define gb_YaccTarget__command
......
......@@ -91,6 +91,10 @@ $(call gb_Helper_abbreviate_dirs,\
-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7)),$(1),$(3))
endef
# No ccache with MSVC, no need to create a checksum for it.
define gb_PrecompiledHeader__sum_command
endef
# AsmObject class
gb_AsmObject_get_source = $(1)/$(2).asm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment