Skip to content

Commit c8c53fe

Browse files
committed
Recommend using cmake -G Ninja in the tutorial
It turns out that some generators (like Unix Makefiles) automatically compress command-lines using response (.rsp) files if they exceed a certain number of characters. There is no way to disable this behavior, and it is language-specific. Any options that are hidden inside an .rsp file is passed to the compiler using a compiler-specific option, and the .rsp file itself may not exist when we try to run our analysis. Using Ninja avoids this issue, and thus produces better results. Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent 4b320c1 commit c8c53fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/source/compilation-databases.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ obtain a compilation database for the CPU:
5454
.. code :: sh
5555
5656
$ mkdir build-cpu
57-
$ cmake ../
57+
$ cmake -G Ninja ../
5858
$ ls
5959
6060
CMakeCache.txt CMakeFiles Makefile cmake_install.cmake compile_commands.json
6161
62+
.. tip::
63+
Using the "Ninja" generator is not required, but is often faster and can
64+
improve the quality of CBI's results. Other generators (such as "Unix
65+
Makefiles") may use response (:code:`.rsp`) files to pass command-line
66+
options, and any options passed this way will not be respected by CBI.
67+
6268
This :code:`compile_commands.json` file includes all the commands required to
6369
build the code, corresponding to the commands that would be executed if we were
6470
to actually run :code:`make`.

0 commit comments

Comments
 (0)