diff options
author | Angelo Ribeiro <Angelo.Ribeiro@criticaltechworks.com> | 2023-08-17 10:01:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-21 11:34:05 +0100 |
commit | 87cb2be71e0c0c123eaae6a5ae135900c95535db (patch) | |
tree | d87095569d124b04d785faaea6123ed3a6f33a17 /meta/classes | |
parent | e6c87b267252376ca85b534e3c9ee9b77ff665ca (diff) | |
download | openembedded-core-contrib-87cb2be71e0c0c123eaae6a5ae135900c95535db.tar.gz |
ccache.bbclass: Add allowed list for native recipes
Native recipes are not able to use ccache currently, due to a circular
dependency between ccache-native and cmake-native.
This affects also other native recipes, but not all, imposing a
limitation in build time optimizations.
The introduction of CCACHE_NATIVE_RECIPES_ALLOWED allows the user to specify
which native recipes should use ccache, keeping it disable by default for all
native recipes.
Signed-off-by: Angelo Ribeiro <Angelo.Ribeiro@criticaltechworks.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/ccache.bbclass | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass index 34becb69d1..262db6672c 100644 --- a/meta/classes/ccache.bbclass +++ b/meta/classes/ccache.bbclass @@ -28,6 +28,11 @@ # be shared between different builds. CCACHE_TOP_DIR ?= "${TMPDIR}/ccache" +# ccache-native and cmake-native have a circular dependency +# that affects other native recipes, but not all. +# Allows to use ccache in specified native recipes. +CCACHE_NATIVE_RECIPES_ALLOWED ?= "" + # ccahe removes CCACHE_BASEDIR from file path, so that hashes will be the same # in different builds. export CCACHE_BASEDIR ?= "${TMPDIR}" @@ -54,9 +59,9 @@ python() { Enable ccache for the recipe """ pn = d.getVar('PN') - # quilt-native doesn't need ccache since no c files - if not (bb.data.inherits_class("native", d) or - bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))): + if (pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or + not (bb.data.inherits_class("native", d) or + bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))): d.appendVar('DEPENDS', ' ccache-native') d.setVar('CCACHE', 'ccache ') } |