diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 84c237c9..925e9a9c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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: diff --git a/builder.py b/builder.py index 53f4b6b7..80972ff6 100644 --- a/builder.py +++ b/builder.py @@ -71,11 +71,14 @@ class ExtensionBuilder(build_ext): env = os.environ.copy() env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get("CXXFLAGS", ""), self.distribution.get_version()) - + build_dir = os.path.join(self.build_temp, ext.sourcedir_rel) 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}"] diff --git a/pyproject.toml b/pyproject.toml index caf2fb7c..b248111f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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