diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-10-14 15:01:38 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-10-14 15:01:58 (GMT) |
commit | 153f39f4a56fb89af5e08258853e3c013733df70 (patch) | |
tree | 7c57092dcdd50646337cad54e680f196abce11b0 /Utilities | |
parent | 83663325f664af7ddcf3ecdff746d30d9fca3420 (diff) | |
parent | d6f5e67f7bce23d77ab98ef935f53d467b562bab (diff) | |
download | CMake-153f39f4a56fb89af5e08258853e3c013733df70.zip CMake-153f39f4a56fb89af5e08258853e3c013733df70.tar.gz CMake-153f39f4a56fb89af5e08258853e3c013733df70.tar.bz2 |
Merge topic 'clang-tidy-plugin-stub'
d6f5e67f7b ci: add clang-tidy plugin to clang-tidy job
6c6912123e clang-tidy: Add option to load CMake's clang-tidy module
0ad3941f73 clang-tidy module: Add stub module
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7768
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/ClangTidyModule/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Utilities/ClangTidyModule/Module.cxx | 22 |
2 files changed, 37 insertions, 0 deletions
diff --git a/Utilities/ClangTidyModule/CMakeLists.txt b/Utilities/ClangTidyModule/CMakeLists.txt new file mode 100644 index 0000000..bd87977 --- /dev/null +++ b/Utilities/ClangTidyModule/CMakeLists.txt @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. +cmake_minimum_required(VERSION 3.13) +project(CMakeClangTidyModule C CXX) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Clang REQUIRED) + +add_library(cmake-clang-tidy-module MODULE + Module.cxx + ) +target_include_directories(cmake-clang-tidy-module PRIVATE ${CLANG_INCLUDE_DIRS}) +target_link_libraries(cmake-clang-tidy-module PRIVATE clang-tidy) diff --git a/Utilities/ClangTidyModule/Module.cxx b/Utilities/ClangTidyModule/Module.cxx new file mode 100644 index 0000000..4bb6dc0 --- /dev/null +++ b/Utilities/ClangTidyModule/Module.cxx @@ -0,0 +1,22 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include <clang-tidy/ClangTidyModule.h> +#include <clang-tidy/ClangTidyModuleRegistry.h> + +namespace clang { +namespace tidy { +namespace cmake { +class CMakeClangTidyModule : public ClangTidyModule +{ +public: + void addCheckFactories(ClangTidyCheckFactories& CheckFactories) override + { + // TODO + } +}; + +static ClangTidyModuleRegistry::Add<CMakeClangTidyModule> X( + "cmake-clang-tidy", "Adds lint checks for the CMake code base."); +} +} +} |