D99 Enable compiler caches

This commit is contained in:
Mat Sutcliffe
2019-02-08 20:27:56 +00:00
parent 08b1141072
commit bb59007656
6 changed files with 50 additions and 10 deletions

View File

@@ -37,6 +37,7 @@ class Builder:
"""
print('Preparing environment ...')
os.environ['PATH'] += os.pathsep + self._get_qt_binary_path()
self._ccache_prepare()
self._specific_prepare()
print('Updating from datastore ...')
@@ -46,6 +47,15 @@ class Builder:
shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share'))
datastore.update_shared(host, datastore_version, shared_path)
def _ccache_prepare(self):
os.environ['CCACHE_NODIRECT'] = '1'
os.environ['CLCACHE_NODIRECT'] = '1'
os.environ['CLCACHE_COMPRESS'] = '1'
os.environ['CLCACHE_OBJECT_CACHE_TIMEOUT_MS'] = str(10 * 60 * 1000)
os.environ['CLCACHE_DIR'] = 'C:\\clcache' # workaround https://github.com/frerich/clcache/issues/342
os.environ['CLCACHE_BASEDIR'] = os.environ['WORKSPACE']
os.environ['CCACHE_BASEDIR'] = os.environ['WORKSPACE']
def build(self, jobs, qmake_args, dev_build, eolInMonth):
"""
Run the build itself. Pass dev_build=True to enable a dev build
@@ -69,6 +79,7 @@ class Builder:
print('Setting EOL date to ' + eolDate.strftime('%Y%m%d'))
qmake_call += ['SWIFT_CONFIG.endOfLife=' + eolDate.strftime('%Y%m%d')]
qmake_call += ['SWIFT_CONFIG.ccache=true']
qmake_call += ['-r', os.pardir]
subprocess.check_call(qmake_call, env=dict(os.environ))