summaryrefslogtreecommitdiffstats
path: root/solenv/gbuild/gbuild.mk
diff options
context:
space:
mode:
Diffstat (limited to 'solenv/gbuild/gbuild.mk')
-rw-r--r--solenv/gbuild/gbuild.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 08c82f5e8d1f..6d074400748d 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -377,4 +377,22 @@ endif
endef
+# Setup for ccache.
+ifneq ($(gb_ENABLE_PCH),)
+# CCACHE_SLOPPINESS should contain pch_defines,time_macros for PCHs.
+gb_CCACHE_SLOPPINESS :=
+ifeq ($(shell test -z "$$CCACHE_SLOPPINESS" && echo 1),1)
+gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=pch_defines,time_macros
+else
+ifeq ($(shell echo "$$CCACHE_SLOPPINESS" | grep -q pch_defines | grep -q time_macros && echo 1),1)
+gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS:pch_defines,time_macros
+endif
+endif
+gb_COMPILER_SETUP += $(gb_CCACHE_SLOPPINESS)
+endif
+
+ifneq ($(CCACHE_DEPEND_MODE),)
+gb_COMPILER_SETUP += CCACHE_DEPEND=1
+endif
+
# vim: set noet sw=4: