From b2b1faa40323efa1d686f98585be77475e774657 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Dec 2022 10:25:31 -0500 Subject: CMake: add option to export clang-tidy fixes to a directory --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a61113a..0485b04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,6 +277,15 @@ if(CMake_RUN_CLANG_TIDY) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMake_CLANG_TIDY_MODULE}") endif() + set(CMake_CLANG_TIDY_EXPORT_FIXES_DIR "" CACHE PATH "Directory to put clang-tidy fix files in.") + mark_as_advanced(CMake_CLANG_TIDY_EXPORT_FIXES_DIR) + if(CMake_CLANG_TIDY_EXPORT_FIXES_DIR) + if(NOT IS_ABSOLUTE "${CMake_CLANG_TIDY_EXPORT_FIXES_DIR}") + message(FATAL_ERROR "CMake_CLANG_TIDY_EXPORT_FIXES_DIR must be an absolute path!") + endif() + set(CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR "${CMake_CLANG_TIDY_EXPORT_FIXES_DIR}") + endif() + # Create a preprocessor definition that depends on .clang-tidy content so # the compile command will change when .clang-tidy changes. This ensures # that a subsequent build re-runs clang-tidy on all sources even if they -- cgit v0.12