Site Tools


Sidebar

Work

Projects Travel Singapore Socials (External)

projects:software:platformio_notes

PlatformIO Notes

ccache with PlatformIO

Installation

brew install ccache

Setup

Create ~/.platformio/scripts/ccache.py:

Import("env")
import shutil
 
ccache = shutil.which("ccache")
if not ccache:
    Return()
 
def wrap(val):
    if val and not val.startswith("ccache "):
        return "ccache " + val
    return val
 
env["CC"]  = wrap(env["CC"])
env["CXX"] = wrap(env["CXX"])
env["AS"]  = wrap(env["AS"])

Add to ~/.zshrc:

export PLATFORMIO_EXTRA_SCRIPTS="${HOME}/.platformio/scripts/ccache.py"

Applies globally to all PlatformIO projects without modifying any project files.

projects/software/platformio_notes.txt · Last modified: by Andrew Yong