summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/ccache.bbclass14
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index 7daaa7e3aa..5ce23e50f3 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -12,17 +12,22 @@
12# 12#
13# - Disable ccache for a recipe 13# - Disable ccache for a recipe
14# Add the following line to the recipe if it can't be built with ccache: 14# Add the following line to the recipe if it can't be built with ccache:
15# CCACHE_DISABLE = '1' 15# CCACHE_DISABLE = "1"
16# 16#
17# - Share ccache files between different builds 17# - Share ccache files between different builds
18# Set CCACHE_TOP_DIR to a shared dir 18# Set CCACHE_TOP_DIR to a shared dir
19# CCACHE_TOP_DIR = /path/to/shared_ccache/ 19# CCACHE_TOP_DIR = "/path/to/shared_ccache/"
20# 20#
21# - TO debug ccahe 21# - To debug ccache
22# export CCACHE_DEBUG = "1" 22# export CCACHE_DEBUG = "1"
23# export CCACHE_LOGFILE = "${CCACHE_DIR}/logfile.log" 23# export CCACHE_LOGFILE = "${CCACHE_DIR}/logfile.log"
24# And also set PARALLEL_MAKE = "-j 1" to get make the log in order 24# And also set PARALLEL_MAKE = "-j 1" to get make the log in order
25# 25#
26# By default this class will only use ccache for target builds, and build
27# our own ccache-native. It is possible to use a host-provided ccache that
28# can then be used by native recipes too by setting:
29# ASSUME_PROVIDED += "ccache-native"
30# HOSTTOOLS += "ccache"
26 31
27# Set it to a shared location for different builds, so that cache files can 32# Set it to a shared location for different builds, so that cache files can
28# be shared between different builds. 33# be shared between different builds.
@@ -46,7 +51,8 @@ python() {
46 Enable ccache for the recipe 51 Enable ccache for the recipe
47 """ 52 """
48 pn = d.getVar('PN') 53 pn = d.getVar('PN')
49 if (pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or 54 if ("ccache" in d.getVar("HOSTTOOLS").split() or
55 pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or
50 not (bb.data.inherits_class("native", d) or 56 not (bb.data.inherits_class("native", d) or
51 bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))): 57 bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))):
52 d.appendVar('DEPENDS', ' ccache-native') 58 d.appendVar('DEPENDS', ' ccache-native')