mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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. (From OE-Core rev: 87cb2be71e0c0c123eaae6a5ae135900c95535db) 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>
This commit is contained in:
committed by
Richard Purdie
parent
853e98f54b
commit
8f98a81394
@@ -28,6 +28,11 @@
|
|||||||
# be shared between different builds.
|
# be shared between different builds.
|
||||||
CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
|
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
|
# ccahe removes CCACHE_BASEDIR from file path, so that hashes will be the same
|
||||||
# in different builds.
|
# in different builds.
|
||||||
export CCACHE_BASEDIR ?= "${TMPDIR}"
|
export CCACHE_BASEDIR ?= "${TMPDIR}"
|
||||||
@@ -54,9 +59,9 @@ python() {
|
|||||||
Enable ccache for the recipe
|
Enable ccache for the recipe
|
||||||
"""
|
"""
|
||||||
pn = d.getVar('PN')
|
pn = d.getVar('PN')
|
||||||
# quilt-native doesn't need ccache since no c files
|
if (pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or
|
||||||
if not (bb.data.inherits_class("native", d) or
|
not (bb.data.inherits_class("native", d) or
|
||||||
bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
|
bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))):
|
||||||
d.appendVar('DEPENDS', ' ccache-native')
|
d.appendVar('DEPENDS', ' ccache-native')
|
||||||
d.setVar('CCACHE', 'ccache ')
|
d.setVar('CCACHE', 'ccache ')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ BUSYBOX_SPLIT_SUID[doc] = "For the BusyBox recipe, specifies whether to split th
|
|||||||
#C
|
#C
|
||||||
|
|
||||||
CACHE[doc] = "The directory holding the cache of the metadata."
|
CACHE[doc] = "The directory holding the cache of the metadata."
|
||||||
|
CCACHE_NATIVE_RECIPES_ALLOWED[doc] = "A list of native recipes to use Ccache, this variable is useful to bypass a circular dependency between ccache-native and cmake-native that inhibits to use Ccache in other native recipes."
|
||||||
CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as TARGET_CFLAGS."
|
CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as TARGET_CFLAGS."
|
||||||
CLASSOVERRIDE[doc] = "An internal variable specifying the special class override that should currently apply (e.g. "class-target", "class-native", and so forth)."
|
CLASSOVERRIDE[doc] = "An internal variable specifying the special class override that should currently apply (e.g. "class-target", "class-native", and so forth)."
|
||||||
CLEANBROKEN[doc] = "Specifies if 'make clean' does not work for a recipe (and therefore the build system should not try to use it during do_configure)"
|
CLEANBROKEN[doc] = "Specifies if 'make clean' does not work for a recipe (and therefore the build system should not try to use it during do_configure)"
|
||||||
|
|||||||
Reference in New Issue
Block a user