Skip to content

Commit

Permalink
[script] add ccache to build script to speed up builds when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnotran committed May 28, 2024
1 parent eaf5110 commit 1a4a4b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ jobs:
with:
submodules: true

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.gcc_ver }}

- name: Zero ccache stats
run: ccache -z

- name: Create LFS file hash list
run: git -C third_party/silabs/gecko_sdk lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

Expand All @@ -85,6 +93,9 @@ jobs:
export PATH=${HOME}/.local/${{ matrix.gcc_extract_dir }}/bin:$PATH
script/test
- name: Print ccache stats
run: ccache -s

- name: Gather SLC generated files
if: failure()
run: |
Expand Down
2 changes: 2 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ install_packages_apt()
# Install dependencies
sudo apt-get update
apt_packages=(
ccache
coreutils
git
git-lfs
Expand Down Expand Up @@ -77,6 +78,7 @@ install_packages_brew()
echo 'Installing script dependencies...'

brew_packages=(
ccache
coreutils
git
git-lfs
Expand Down
4 changes: 3 additions & 1 deletion script/build
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ build_soc()
-DOT_APP_RCP=OFF \
-DOT_COMPILE_WARNING_AS_ERROR=ON \
"$@" "${repo_dir}" \
--graphviz=graph.dot
--graphviz=graph.dot \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache

ninja "${soc_targets[@]}"

Expand Down

0 comments on commit 1a4a4b4

Please sign in to comment.