summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-11-30 11:22:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-30 15:44:49 +0100
commitda2d40bb2b0b81cb891e2a334d672bb2790a7c23 (patch)
tree22c9e28b28df7ade87e8d9c7c062603c13a0176a /solenv
parentafdfc9bb5d56fde866882e7d87869ecafed1e3d0 (diff)
use -fno-pch-timestamp also with clang-cl
Change-Id: Ib985a22040a3cebea5ccb303576065a48f73d3ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126112 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk9
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk7
2 files changed, 16 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 2ca7466836b5..55a35f9ba661 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -116,6 +116,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(EXTERNAL_CODE),$(if $(COM_IS_CLANG),-Wno-undef),$(gb_DEFS_INTERNAL)) \
$(if $(filter YES,$(LIBRARY_X64)), ,$(gb_LTOFLAGS)) \
$(gb_COMPILERDEPFLAGS) \
+ $(gb_NO_PCH_TIMESTAMP) \
$(5) \
-c $(3) \
-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -I$(dir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) \
@@ -123,6 +124,13 @@ $(call gb_Helper_abbreviate_dirs,\
$(call gb_Trace_EndRange,$(2),PCH)
endef
+ifeq ($(COM_IS_CLANG),TRUE)
+# Clang has -fno-pch-timestamp, just checksum the file for CCACHE_PCH_EXTSUM
+# $(call gb_PrecompiledHeader__sum_command,pchfile,pchtarget,source,cxxflags,includes,linktargetmakefilename,compiler)
+define gb_PrecompiledHeader__sum_command
+ $(SHA256SUM) $(1) >$(1).sum
+endef
+else
# MSVC does not generate the same .pch for the same input, so checksum the (preprocessed) input
# $(call gb_PrecompiledHeader__sum_command,pchfile,pchtarget,source,cxxflags,includes,linktargetmakefilename,compiler)
define gb_PrecompiledHeader__sum_command
@@ -139,6 +147,7 @@ $(call gb_Helper_abbreviate_dirs,\
2>&1 | $(SHA256SUM) >$(1).sum \
)
endef
+endif
# When building a PCH, MSVC also creates a .pdb file with debug info. So for reuse
# add the .pdb to the PCH's files and then use the .pdb also for linktargets that reuse the PCH.
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index c7f302c0b5d1..08e799033eb5 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -210,6 +210,13 @@ gb_LinkTarget_EXCEPTIONFLAGS := \
gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
+ifneq ($(gb_ENABLE_PCH),)
+ifeq ($(COM_IS_CLANG),TRUE)
+# the same as in com_GCC_defs.mk
+gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp
+endif
+endif
+
gb_LinkTarget_LDFLAGS := \
$(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-nologo,) \
$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \