diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-08-31 18:15:37 (GMT) |
---|---|---|
committer | Igor-Mikhail-Valentin Glebov <iglebov@albany.edu> | 2022-10-12 17:23:45 (GMT) |
commit | 0ad3941f737957fdb731eeb092ec13a1f8ca57a9 (patch) | |
tree | ce1439a9e4095dd2c07a137c67903b0038511df9 /Utilities | |
parent | f6af01b53d2531167d7bb11ef53df889735bf97b (diff) | |
download | CMake-0ad3941f737957fdb731eeb092ec13a1f8ca57a9.zip CMake-0ad3941f737957fdb731eeb092ec13a1f8ca57a9.tar.gz CMake-0ad3941f737957fdb731eeb092ec13a1f8ca57a9.tar.bz2 |
clang-tidy module: Add stub module
Issue: #23912
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."); +} +} +} |