Add a section for clang to doc/make/ccache.md
This commit is contained in:
parent
626ba7247b
commit
8f88fcaf93
1 changed files with 18 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
Using ccache
|
||||
------------
|
||||
============
|
||||
|
||||
[ccache](http://ccache.samba.org/manual.html) is available in many
|
||||
systems, and can dramatically improve compilation times. In particular
|
||||
|
@ -9,6 +9,9 @@ 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:
|
||||
|
@ -24,3 +27,17 @@ 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 supprress "clang: warning:
|
||||
argument unused during compilation:" warning.
|
||||
- ``-fcolor-diagnostics`` option is used to enable clang's colored
|
||||
diagnostic messages.
|
||||
|
|
Loading…
Reference in a new issue