Skip to content

Commit 5593dd1

Browse files
TrottBethGriggs
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 2d4a042 commit 5593dd1

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
@@ -523,6 +523,8 @@ $ make test-only
523523
If you plan to frequently rebuild Node.js, especially if using several branches,
524524
installing `ccache` can help to greatly reduce build times. Set up with:
525525

526+
On GNU/Linux:
527+
526528
```console
527529
$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
528530
$ ccache -o cache_dir=<tmp_dir>
@@ -531,6 +533,16 @@ $ export CC="ccache gcc" # add to your .profile
531533
$ export CXX="ccache g++" # add to your .profile
532534
```
533535

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

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

0 commit comments

Comments
 (0)