summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-07 15:19:55 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-10-07 15:20:03 (GMT)
commita07be2ffd18a03cc30153f8bafbe47f8e640eb44 (patch)
tree741906773394f23827506ef5ed656651758c57ce /Help
parent5f9994a6c1abe28522c1fd21783f4d3d60a8f3fb (diff)
parent3f4e0839c48480b0cb3396ddbcadef25e69854ee (diff)
downloadCMake-a07be2ffd18a03cc30153f8bafbe47f8e640eb44.zip
CMake-a07be2ffd18a03cc30153f8bafbe47f8e640eb44.tar.gz
CMake-a07be2ffd18a03cc30153f8bafbe47f8e640eb44.tar.bz2
Merge topic 'clang-tidy-prefer-p-option'
3f4e0839c4 clang-tidy: Don't append compiler commands if using -p Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7753
Diffstat (limited to 'Help')
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst18
-rw-r--r--Help/release/dev/clang-tidy-prefer-p-option.rst5
2 files changed, 20 insertions, 3 deletions
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index af16d3c..ffa0b9a 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -3,13 +3,25 @@
.. versionadded:: 3.6
-This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` or ``OBJCXX``.
+This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC``
+or ``OBJCXX``.
-Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
-line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing
+a command line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
+The specified ``clang-tidy`` command line will be invoked with additional
+arguments specifying the source file and, after ``--``, the full compiler
+command line.
+
+.. versionchanged:: 3.25
+
+ If the specified ``clang-tidy`` command line includes the ``-p`` option,
+ it will invoked without ``--`` and the full compiler command line.
+ ``clang-tidy`` will look up the source file in the specified compiler
+ commands database.
+
This property is initialized by the value of
the :variable:`CMAKE_<LANG>_CLANG_TIDY` variable if it is set
when a target is created.
diff --git a/Help/release/dev/clang-tidy-prefer-p-option.rst b/Help/release/dev/clang-tidy-prefer-p-option.rst
new file mode 100644
index 0000000..816c7dd
--- /dev/null
+++ b/Help/release/dev/clang-tidy-prefer-p-option.rst
@@ -0,0 +1,5 @@
+clang-tidy-prefer-p-option
+--------------------------
+
+* If :prop_tgt:`<LANG>_CLANG_TIDY` includes a ``-p`` argument, the
+ full compiler command line is no longer appended after ``--``.