Use ccache to speed up build

This commit is contained in:
Robert Taylor 2023-07-15 12:28:43 +00:00
parent abf08d443d
commit d77950de65
3 changed files with 8 additions and 2 deletions

View File

@ -58,6 +58,8 @@ jobs:
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ENVIRONMENT: USE_CCACHE=1 CCACHE_DIR=/.ccache
CIBW_CONTAINER_ENGINE: "docker; create_args: '--volume=${{ github.workspace }}/.ccache:/.ccache'"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:

View File

@ -76,6 +76,9 @@ class ExtensionBuilder(build_ext):
install_dir = os.path.join(extdir, 'Coriolis')
os.makedirs(build_dir,exist_ok=True)
if "USE_CCACHE" in env:
cmake_args += ["-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"]
cmake_args += [f"-DCMAKE_MODULE_PATH={os.path.abspath('bootstrap/cmake_modules')};"
f"{os.path.join(install_dir, 'share/cmake/Modules')}"]
cmake_args += [f"-DCMAKE_INSTALL_PREFIX={install_dir}"]

View File

@ -53,6 +53,7 @@ before-all = '''
boost-python boost-filesystem \
boost-regex boost-wave \
python36-devel libxml2-devel \
qwt-devel
qwt-devel \
ccache
'''
build-verbosity=2