diff options
-rw-r--r-- | solenv/gbuild/PrecompiledHeaders.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 26 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 4 |
3 files changed, 31 insertions, 1 deletions
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk index e7df26abd77a..9bf64e2e4cbb 100644 --- a/solenv/gbuild/PrecompiledHeaders.mk +++ b/solenv/gbuild/PrecompiledHeaders.mk @@ -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))) && \ diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index b9f9e3ea62aa..73c9b1cc4175 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -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 diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 5a02ea57eeac..705e50a7a563 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -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 |