Repository navigation
Set up ccache in CMake and add it to the Mac build guide - #1847
Merged
Merged
Conversation
New worktrees and branch switches on Mac rebuild everything from scratch. The macos-ccache preset is RelWithDebInfo plus a shared 10 GB ccache with checkout-relative paths, so worktrees reuse each other's compiles. A short guide is linked from the Mac build instructions. Other presets and CI are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
approved these changes
Nov 6, 2026
Address review on #1767. - Add cmake/Ccache.cmake, included from CMakeLists.txt. With -DPA_USE_CCACHE=ON (default OFF) and ccache 4.8+ installed, every compile runs through ccache: - PA_CCACHE_CONFIG: ccache settings passed on every compile's command line. The default keeps this project's cache in a "PA-Arduino-Source" folder inside ccache's own cache folder, and sets base_dir to the checkout's root folder, so all worktrees share one cache without changing ccache's global config. - PA_CCACHE_DEBUG_PATHS (default ON): adds -fdebug-prefix-map and -fdebug-compilation-dir to Debug and RelWithDebInfo builds, so builds with debug info share the cache across worktrees too. - Stops with an error if a compiler launcher is also given, or if ccache is older than 4.8. - Mac build guide: install ccache as a normal step, turn it on in the CMake command, and add "Part 7: Tuning ccache". - Remove the macos-ccache preset and Build-Mac-CompilerCache.md: the preset's settings are now in cmake/Ccache.cmake, and the guide covers the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gin890
force-pushed
the
build/macos-ccache-preset
branch
from
November 7, 2026 04:53
fb2055a to
d3c8f52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues #1767 to add ccache in CMake:
This PR adds in CMake a new option
-DPA_USE_CCACHE=ONto use ccache.When turned on, it sets ccache if ccache is installed on OS and also sets up ccache and c++ flags so the cache can be shared across worktrees. This enables cross worktree fast compiliation and benefits mutli-session AI agent development.
You can still change ccache configs via new CMake option
PA_CCACHE_CONFIG.You can also turn off the C++ compiler flags change set up to enable cross-worktree cache sharing on debug builds, by setting
PA_CCACHE_DEBUG_PATHS=OFF.