diff --git a/BUILDING.md b/BUILDING.md index c26cdfc9bec3dc..c12a45cfe30120 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -523,6 +523,8 @@ $ make test-only If you plan to frequently rebuild Node.js, especially if using several branches, installing `ccache` can help to greatly reduce build times. Set up with: +On GNU/Linux: + ```console $ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros $ ccache -o cache_dir= @@ -531,6 +533,16 @@ $ export CC="ccache gcc" # add to your .profile $ export CXX="ccache g++" # add to your .profile ``` +On macOS: + +```console +$ brew install ccache # see https://brew.sh +$ ccache -o cache_dir= +$ ccache -o max_size=5.0G +$ export CC="ccache cc" # add to ~/.zshrc or other shell config file +$ export CXX="ccache c++" # add to ~/.zshrc or other shell config file +``` + This will allow for near-instantaneous rebuilds even when switching branches. When modifying only the JS layer in `lib`, it is possible to externally load it