Files
CMake/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
Brad King 13c8dbd5a6 Help: Document CMAKE_UNITY_BUILD/CMAKE_EXPORT_COMPILE_COMMANDS limitation
These two options currently do not work well together.  Mention this
limitation in the documentation.

Issue: #19826
2019-10-11 08:05:59 -04:00

35 lines
968 B
ReStructuredText

CMAKE_EXPORT_COMPILE_COMMANDS
-----------------------------
Enable/Disable output of compile commands during generation.
If enabled, generates a ``compile_commands.json`` file containing the exact
compiler calls for all translation units of the project in machine-readable
form. The format of the JSON file looks like:
.. code-block:: javascript
[
{
"directory": "/home/user/development/project",
"command": "/usr/bin/c++ ... -c ../foo/foo.cc",
"file": "../foo/foo.cc"
},
...
{
"directory": "/home/user/development/project",
"command": "/usr/bin/c++ ... -c ../foo/bar.cc",
"file": "../foo/bar.cc"
}
]
.. note::
This option is implemented only by :ref:`Makefile Generators`
and the :generator:`Ninja`. It is ignored on other generators.
This option currently does not work well in combination with
the :prop_tgt:`UNITY_BUILD` target property or the
:variable:`CMAKE_UNITY_BUILD` variable.