Skip to content

Commit

Permalink
doc: simplify ccache instructions
Browse files Browse the repository at this point in the history
`ccache` has reasonable defaults for `max_size` and `cache_dir` so
remove instructions to set those things explicitly.

Change fenced code from `console` to `bash` for easier copy/paste.

PR-URL: #40550
Fixes: #40542
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and targos committed Nov 6, 2021
1 parent c1c1738 commit 5e2d0ed
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,22 +521,18 @@ 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=<tmp_dir>
$ ccache -o max_size=5.0G
$ export CC="ccache gcc" # add to your .profile
$ export CXX="ccache g++" # add to your .profile
```bash
sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
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=<tmp_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
```bash
brew install ccache # see https://brew.sh
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.
Expand Down

0 comments on commit 5e2d0ed

Please sign in to comment.