Skip to content

Commit c1c1738

Browse files
Trotttargos
authored andcommitted
doc: fix macOS environment variables for ccache
macOS requires `cc` and `c++` rather than `gcc` and `g++`. Closes: #40542 PR-URL: #40550 Fixes: #40542 Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 6e3e50f commit c1c1738

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

BUILDING.md

+12
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ $ make test-only
519519
If you plan to frequently rebuild Node.js, especially if using several branches,
520520
installing `ccache` can help to greatly reduce build times. Set up with:
521521

522+
On GNU/Linux:
523+
522524
```console
523525
$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
524526
$ ccache -o cache_dir=<tmp_dir>
@@ -527,6 +529,16 @@ $ export CC="ccache gcc" # add to your .profile
527529
$ export CXX="ccache g++" # add to your .profile
528530
```
529531

532+
On macOS:
533+
534+
```console
535+
$ brew install ccache # see https://brew.sh
536+
$ ccache -o cache_dir=<tmp_dir>
537+
$ ccache -o max_size=5.0G
538+
$ export CC="ccache cc" # add to ~/.zshrc or other shell config file
539+
$ export CXX="ccache c++" # add to ~/.zshrc or other shell config file
540+
```
541+
530542
This will allow for near-instantaneous rebuilds even when switching branches.
531543

532544
When modifying only the JS layer in `lib`, it is possible to externally load it

0 commit comments

Comments
 (0)