diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-03-11 19:30:01 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-05-09 11:00:51 +0200 |
commit | b87b0171efb683ff03e99060c0d30474bc3c61e1 (patch) | |
tree | 5525dea15b821ff431ec5c8c17526e36ac014299 | |
parent | cc5916cd314a27b0cc99560ab887480026630a95 (diff) |
use -fno-pch-timestamp when generating Clang PCH files
Change-Id: I52ef8e81cb3899cc8d2b8729bd55ee98a0a1c77b
Reviewed-on: https://gerrit.libreoffice.org/71565
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index 282aacbfd9ec..cad6db124f17 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -98,6 +98,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_COMPILERDEPFLAGS) \ $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ + $(gb_NO_PCH_TIMESTAMP) \ $(6) \ $(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7))) \ -c $(patsubst %.cxx,%.hxx,$(3)) \ diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 3946662d8f67..3f3273753364 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -137,9 +137,18 @@ gb_LinkTarget_LDFLAGS += -fstack-protector-strong endif ifeq ($(ENABLE_PCH),TRUE) -ifneq ($(COM_IS_CLANG),TRUE) +ifeq ($(COM_IS_CLANG),TRUE) +# Clang by default includes in the PCH timestamps of the files it was +# generated from, which would make the PCH be a "new" file for ccache +# even if the file has not actually changed. Disabling the timestamp +# prevents this at the cost of risking using an outdated PCH (which +# should be unlikely, given that gbuild has dependencies set up +# for our includes and system includes are unlikely to change). +gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp +else gb_CFLAGS_COMMON += -fpch-preprocess -Winvalid-pch gb_CXXFLAGS_COMMON += -fpch-preprocess -Winvalid-pch +gb_NO_PCH_TIMESTAMP := endif endif |