diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-10-26 20:19:19 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-10-26 20:19:19 +0100 |
| commit | 0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237 (patch) | |
| tree | 135bcd756bfe0484c71624caf8c8d13a43d1a5ad /CMakeLists.txt | |
| parent | f3b1c84a29e272cc589c300bca5020ccd4685a02 (diff) | |
| download | ttwhy-0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237.tar.xz ttwhy-0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237.zip | |
ide: improve clang-tidy integration
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bdda024..0562c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,15 @@ project("ttwhy" include("CTest") +### System Tools + +find_program(CLANG_TIDY_PATH NAMES + "clang-tidy" + "clang-tidy-22" + "clang-tidy-23" + "clang-tidy-24" +) + ### System Dependencies find_package("Threads") @@ -95,6 +104,16 @@ target_compile_options("ttwhy-core" PUBLIC "$<$<CXX_COMPILER_ID:Clang,GNU>:-pedantic-errors>" ) +if(CLANG_TIDY_PATH) + set_target_properties("ttwhy-core" PROPERTIES + CXX_CLANG_TIDY "${CLANG_TIDY_PATH}" + ) +else() + message(AUTHOR_WARNING + "clang-tidy not found; skipping linting for 'ttwhy::core'" + ) +endif() + ### Applications add_executable("ttwhy-echo") @@ -108,6 +127,16 @@ target_link_libraries("ttwhy-echo" PRIVATE "ttwhy::lib" ) +if(CLANG_TIDY_PATH) + set_target_properties("ttwhy-echo" PROPERTIES + CXX_CLANG_TIDY "${CLANG_TIDY_PATH}" + ) +else() + message(AUTHOR_WARNING + "clang-tidy not found; skipping linting for 'ttwhy::echo'" + ) +endif() + ### Tests if(BUILD_TESTING) |
