diff options
Diffstat (limited to 'share/cmake-3.18/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst')
-rw-r--r-- | share/cmake-3.18/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/share/cmake-3.18/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/share/cmake-3.18/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst new file mode 100644 index 0000000..6d2450b --- /dev/null +++ b/share/cmake-3.18/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -0,0 +1,37 @@ +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" + } + ] + +This is initialized by the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment +variable. + +.. 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. |