summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-30 09:46:14 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-30 09:46:14 +0100
commit0bce69119675dfc8d0145104808e59cff642f941 (patch)
tree73d627d42c6555e94d80c7ade8f5807331d7785f
parent86b88101cf613264812d8416f5abad0287cfd314 (diff)
Some ccache bits.
-rwxr-xr-xcdist8
1 files changed, 8 insertions, 0 deletions
diff --git a/cdist b/cdist
index 9d8e146..56e0527 100755
--- a/cdist
+++ b/cdist
@@ -519,6 +519,8 @@ class DockerTarget(Target):
opts += '-v %s:%s ' % (m, m)
if self.privileged:
opts += '--privileged=true '
+ if self.ccache:
+ opts += "-e CCACHE_DIR=/ccache --volumes-from ccache-%s" % self.image
self.container = command_and_read('%s run -u %s %s -itd %s /bin/bash' % (config.docker(), getpass.getuser(), opts, self.image)).read().strip()
def command(self, cmd):
@@ -653,6 +655,12 @@ class LinuxTarget(DockerTarget):
else:
self.image = '%s-%s-%s' % (self.distro, self.version, self.bits)
+ def setup(self):
+ super(LinuxTarget, self).setup()
+ if self.ccache:
+ self.set('CC', '"ccache gcc"')
+ self.set('CXX', '"ccache g++"')
+
def test(self, tree, test, options):
self.append_with_colon('PATH', '%s/bin' % self.directory)
self.append_with_colon('LD_LIBRARY_PATH', '%s/lib' % self.directory)