summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-12-13 17:12:41 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-14 11:21:57 +0000
commit35d7fe73bba15de16d2eb0a4b12ef03b57b23306 (patch)
treedfd6890323f8f7d0772faaa647434057a933d00d
parentb25271b65262f70d849a4861da216c9be6c54d53 (diff)
downloadopenembedded-core-contrib-35d7fe73bba15de16d2eb0a4b12ef03b57b23306.tar.gz
openembedded-core-contrib-35d7fe73bba15de16d2eb0a4b12ef03b57b23306.tar.bz2
openembedded-core-contrib-35d7fe73bba15de16d2eb0a4b12ef03b57b23306.zip
ccache.bbclass: Make it can be shared between different builds
CCACHE_BASEDIR: ccache removes this from file path, so that hashes will be the same in different build dirs. CCACHE_TOP_DIR: Set it to a shared location for different builds. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/ccache.bbclass22
1 files changed, 21 insertions, 1 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index 59e1022678..f3612c5019 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -8,8 +8,28 @@
# Add the following line to the recipe if it can't be built with ccache:
# CCACHE_DISABLE = '1'
#
+# - Share ccache files between different builds
+# Set CCACHE_TOP_DIR to a shared dir
+# CCACHE_TOP_DIR = /path/to/shared_ccache/
+#
+# - TO debug ccahe
+# export CCACHE_DEBUG = "1"
+# export CCACHE_LOGFILE = "${CCACHE_DIR}/logfile.log"
+# And also set PARALLEL_MAKE = "-j 1" to get make the log in order
+#
+
+# Set it to a shared location for different builds, so that cache files can
+# be shared between different builds.
+CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
+
+# ccahe removes CCACHE_BASEDIR from file path, so that hashes will be the same
+# in different builds.
+export CCACHE_BASEDIR ?= "${TMPDIR}"
+
+# Used for sharing cache files after compiler is rebuilt
+export CCACHE_COMPILERCHECK ?= "%compiler% -dumpspecs"
-export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}"
+export CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${MULTIMACH_TARGET_SYS}/${PN}"
# We need to stop ccache considering the current directory or the
# debug-prefix-map target directory to be significant when calculating