diff options
author | Brad King <brad.king@kitware.com> | 2016-01-19 14:35:38 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-01-19 14:35:38 (GMT) |
commit | ceeea23323837bd3cd51f35dd339d4c6f9414c78 (patch) | |
tree | e072e627785854c51987e69dfdbbd93481b58457 | |
parent | 790959aa9df923ae78ab5cb3c347a4413418273d (diff) | |
parent | 6e92f7b2de3d6a25e4e77e274de110a2974c74ca (diff) | |
download | CMake-ceeea23323837bd3cd51f35dd339d4c6f9414c78.zip CMake-ceeea23323837bd3cd51f35dd339d4c6f9414c78.tar.gz CMake-ceeea23323837bd3cd51f35dd339d4c6f9414c78.tar.bz2 |
Merge topic 'doc-export-compile-commands'
6e92f7b2 Help: Document the CMAKE_EXPORT_COMPILE_COMMANDS variable
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 3f49572..15eaece 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -118,6 +118,7 @@ Variables that Change Behavior /variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName /variable/CMAKE_ERROR_DEPRECATED /variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + /variable/CMAKE_EXPORT_COMPILE_COMMANDS /variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY /variable/CMAKE_SYSROOT /variable/CMAKE_FIND_APPBUNDLE diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst new file mode 100644 index 0000000..8776279 --- /dev/null +++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -0,0 +1,30 @@ +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. |