#
# Usage:
+# - Install ccache package on the host distribution and set up a build directory
+#
# - Enable ccache
# Add the following line to a conffile such as conf/local.conf:
# INHERIT += "ccache"
# quilt-native doesn't need ccache since no c files
if not (pn in ('ccache-native', 'quilt-native') or
bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
- d.appendVar('DEPENDS', ' ccache-native')
d.setVar('CCACHE', 'ccache ')
}
HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"])) else ''}"
# Link to these if present
-HOSTTOOLS_NONFATAL += "aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
+HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
# Temporary add few more detected in bitbake world
HOSTTOOLS_NONFATAL += "join nl size yes zcat"
self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
def test_ccache_tool(self):
- bitbake("ccache-native")
- bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
- p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
- self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
+ bb_vars = get_bb_vars(['HOSTTOOLS_DIR'], 'm4-native')
+ p = bb_vars['HOSTTOOLS_DIR'] + "/" + "ccache"
+ if not os.path.isfile(p):
+ self.skipTest("No ccache binary found in %s" % bb_vars['HOSTTOOLS_DIR'])
self.write_config('INHERIT += "ccache"')
self.add_command_to_tearDown('bitbake -c clean m4-native')
bitbake("m4-native -c clean")