summaryrefslogtreecommitdiffstats
path: root/meta/classes/ccache.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/ccache.bbclass')
-rw-r--r--meta/classes/ccache.bbclass17
1 files changed, 14 insertions, 3 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index 4532894c57..262db6672c 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -1,4 +1,10 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
2# Usage: 8# Usage:
3# - Enable ccache 9# - Enable ccache
4# Add the following line to a conffile such as conf/local.conf: 10# Add the following line to a conffile such as conf/local.conf:
@@ -22,6 +28,11 @@
22# be shared between different builds. 28# be shared between different builds.
23CCACHE_TOP_DIR ?= "${TMPDIR}/ccache" 29CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
24 30
31# ccache-native and cmake-native have a circular dependency
32# that affects other native recipes, but not all.
33# Allows to use ccache in specified native recipes.
34CCACHE_NATIVE_RECIPES_ALLOWED ?= ""
35
25# ccahe removes CCACHE_BASEDIR from file path, so that hashes will be the same 36# ccahe removes CCACHE_BASEDIR from file path, so that hashes will be the same
26# in different builds. 37# in different builds.
27export CCACHE_BASEDIR ?= "${TMPDIR}" 38export CCACHE_BASEDIR ?= "${TMPDIR}"
@@ -48,9 +59,9 @@ python() {
48 Enable ccache for the recipe 59 Enable ccache for the recipe
49 """ 60 """
50 pn = d.getVar('PN') 61 pn = d.getVar('PN')
51 # quilt-native doesn't need ccache since no c files 62 if (pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or
52 if not (bb.data.inherits_class("native", d) or 63 not (bb.data.inherits_class("native", d) or
53 bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))): 64 bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))):
54 d.appendVar('DEPENDS', ' ccache-native') 65 d.appendVar('DEPENDS', ' ccache-native')
55 d.setVar('CCACHE', 'ccache ') 66 d.setVar('CCACHE', 'ccache ')
56} 67}