summaryrefslogtreecommitdiffstats
path: root/Help/prop_tgt
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-11-29 18:39:10 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-12-06 15:39:29 (GMT)
commit232467eb1c0dab9156cd8c4af56aad3959cbee4b (patch)
tree2772b01850c143598e642282966401cb976dd421 /Help/prop_tgt
parent7ea665b74da322e96dd3e7f90075143c2957728c (diff)
downloadCMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.zip
CMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.tar.gz
CMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.tar.bz2
clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property
Fixes: #21362
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst29
1 files changed, 29 insertions, 0 deletions
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst b/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst
new file mode 100644
index 0000000..265fade
--- /dev/null
+++ b/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst
@@ -0,0 +1,29 @@
+<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR
+----------------------------------
+
+.. versionadded:: 3.26
+
+This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC``
+or ``OBJCXX``, and only has an effect when :prop_tgt:`<LANG>_CLANG_TIDY` is
+set.
+
+Specify a directory for the ``clang-tidy`` tool to put ``.yaml`` files
+containing its suggested changes in. This can be used for automated mass
+refactoring by ``clang-tidy``. Each object file that gets compiled will have a
+corresponding ``.yaml`` file in this directory. After the build is completed,
+you can run ``clang-apply-replacements`` on this directory to simultaneously
+apply all suggested changes to the code base. If this property is not an
+absolute directory, it is assumed to be relative to the target's binary
+directory. This property should be preferred over adding an ``--export-fixes``
+or ``--fix`` argument directly to the :prop_tgt:`<LANG>_CLANG_TIDY` property.
+
+At generate-time, in order to avoid passing stale fixes from old code to
+``clang-apply-replacements``, CMake will search the directory for any ``.yaml``
+files that won't be generated by ``clang-tidy`` during the build, and delete
+them. In addition, just before running ``clang-tidy`` on a file, CMake will
+delete that file's corresponding ``.yaml`` file in case ``clang-tidy`` doesn't
+produce any fixes.
+
+This property is initialized by the value of
+the :variable:`CMAKE_<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR` variable if it is set
+when a target is created.