Skip to content

Commit 8bef305

Browse files
committed
Enable build caching
1 parent d2c1caa commit 8bef305

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/cmake.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Build plugins
2626
run: |
27-
python3 ./build.py
27+
python3 ./build.py --compiler-launcher ccache
2828
move Build Build-macOS-Universal
2929
3030
- name: Archive Artifacts
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Build plugins
5151
run: |
52-
python3 ./build.py
52+
python3 ./build.py --compiler-launcher ccache
5353
move Build Build-macOS-Legacy
5454
5555
- name: Archive Artifacts
@@ -156,7 +156,7 @@ jobs:
156156

157157
- name: Build plugins
158158
run: |
159-
python3 ./build.py
159+
python3 ./build.py --compiler-launcher ccache
160160
move Build Build-${{ matrix.name }}
161161
162162
- name: Archive Artifacts

build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
import os
66
import shutil
77

8+
import argparse
9+
10+
parser = argparse.ArgumentParser(description="Build plugins with CMake")
11+
parser.add_argument(
12+
"--compiler-launcher",
13+
type=str,
14+
help="Optional compiler launcher (e.g., ccache, sccache)"
15+
)
16+
args = parser.parse_args()
17+
818
# Detect platform and choose CMake generator
919
system = platform.system()
1020
if system == "Darwin": # macOS
@@ -52,6 +62,10 @@
5262
"-DENABLE_GEM=0",
5363
"-DENABLE_SFIZZ=0",
5464
]
65+
if args.compiler_launcher:
66+
cmake_configure.append(f"-DCMAKE_C_COMPILER_LAUNCHER={args.compiler_launcher}")
67+
cmake_configure.append(f"-DCMAKE_CXX_COMPILER_LAUNCHER={args.compiler_launcher}")
68+
5569
result_configure = subprocess.run(cmake_configure, cwd=plugdata_dir)
5670
if result_configure.returncode != 0:
5771
print(f"Failed cmake configure for {name}")

0 commit comments

Comments
 (0)