aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy4
-rw-r--r--CMakeLists.txt29
2 files changed, 29 insertions, 4 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 6794ba6..bf5a3a7 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -62,10 +62,6 @@ CheckOptions:
cppcoreguidelines-avoid-non-const-global-variables.AllowInternalLinkage: true
- modernize-use-std-print.ReplacementPrintFunction: "kstd::print"
- modernize-use-std-print.ReplacementPrintlnFunction: "kstd::println"
- modernize-use-std-print.PrintHeader: "kstd/print"
-
modernize-use-std-ranges.UseReversePipe: true
modernize-use-trailing-return-type.TransformLambdas: none
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)