* HACKING: Mention bear, to build compile_commands.json.
This commit is contained in:
parent
cee2819a45
commit
c9d9c10cb2
1 changed files with 20 additions and 0 deletions
20
HACKING
20
HACKING
|
|
@ -290,6 +290,26 @@ would understand with:
|
|||
make check LOG_DRIVER=$PWD/tools/test-driver-teamcity
|
||||
|
||||
|
||||
Generating compile_commands.json
|
||||
--------------------------------
|
||||
|
||||
The file compile_commands.json is used by many clang tools in order to
|
||||
know how a single file is compiled (in particular, which include paths
|
||||
should be used). Autotools-based build systems do not support the
|
||||
generation of this file, but there is a tool called "bear" (for "Build
|
||||
EAR") that is packaged with most distribution that can be used here.
|
||||
Simply run a full build through "bear" using something like this:
|
||||
|
||||
% ./configure CC=clang-17 CXX=clang++-17
|
||||
% make -j8 clean # make sure your will rebuild everything
|
||||
% bear -- make -j8
|
||||
|
||||
This will simply intercept all command executions are record them in
|
||||
the compile_commands.json database. Depending on the tools you plan to
|
||||
use, you probably want to compile everything with clang, as shown above.
|
||||
|
||||
|
||||
|
||||
C++ Coding conventions
|
||||
======================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue