doc: update ccache docs

This commit is contained in:
Sebastian Ullrich 2019-11-25 14:09:42 +01:00
parent df3112d54d
commit cf0808c0c3
2 changed files with 4 additions and 48 deletions

View file

@ -1,45 +0,0 @@
Using ccache
============
[ccache](http://ccache.samba.org/manual.html) is available in many
systems, and can dramatically improve compilation times. In particular
if we are constantly switching between different branches.
On Ubuntu, we can install ccache by executing
sudo apt-get install ccache
Using ccache with g++
---------------------
Then, we can create a simple script that invokes ccache with our
favorite C++ 11 compiler. For example, we can create the script
`~/bin/ccache-g++` with the following content:
#!/bin/sh
ccache g++ "$@"
Then, we instruct cmake to use `ccache-g++` as our C++ compiler
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_COMPILER=~/bin/ccache-g++ ../../src
We usually use Ninja instead of make. Thus, our cmake command
line is:
cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_COMPILER=~/bin/ccache-g++ -G Ninja ../../src
Using ccache with clang++
-------------------------
To use ccache with clang++, create the script ``~/bin/ccache-clang++``
with the following content:
#!/bin/sh
ccache clang++ -Qunused-arguments -fcolor-diagnostics "$@"
- ``-Qunused-arguments`` option is used to suppress "clang: warning:
argument unused during compilation:" warning.
- ``-fcolor-diagnostics`` option is used to enable clang's colored
diagnostic messages.
Reference: http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html

View file

@ -59,9 +59,7 @@ Pass these along with the `cmake ../../src` command.
* `-D CMAKE_C_COMPILER=`\
`-D CMAKE_CXX_COMPILER=`\
Select the C++ compiler to use. Because of the bootstrapped build (see below),
it is highly recommended to use [CCache](ccache.md) to reduce redundant
compilations
Select the C++ compiler to use.
* `-D CHECK_OLEAN_VERSION=OFF`\
The `.olean` files are tagged with the Lean version they were produced with.
@ -69,6 +67,9 @@ Pass these along with the `cmake ../../src` command.
every `git commit`. Use this option to avoid the version check. The `.olean`
files can be removed manually by invoking `make/ninja clean-olean`.
Lean will automatically use [CCache](https://ccache.dev/) if available to avoid
redundant builds, especially after stage 0 has been updated (see below).
Lean Build Pipeline
-------------------