From 2c08ecdb6f77339818d1228e7415df33190b5796 Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Thu, 26 Sep 2024 15:43:30 +0200
Subject: [PATCH] MAINT: Updated clang tools to 16, added early checks.

---
 Makefile            | 13 +++++++++++--
 README.md           |  4 ++--
 test/CMakeLists.txt |  2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index ddc4670..c1475b8 100644
--- a/Makefile
+++ b/Makefile
@@ -57,15 +57,24 @@ format:
 
 build-debug: conan-install-debug
 	# cmake --preset conan-debug && cmake --build build/Debug # for CMake >= 3.23
+	@command -v iwyu || command include-what-you-use || \
+	  (echo "Could not find 'iwyu', exiting."; exit 1)
+	@command -v clang-tidy || command -v clang-tidy-16 || \
+	  (echo "Could not find 'clang-tidy'(-16), exiting."; exit 1)
 	cd build/Debug &&\
 	cmake -S ../.. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake  -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug &&\
 	cmake --build .
 
 build-release: conan-install-release
 	# cmake --preset conan-release # for CMake >= 3.23
+	@command -v iwyu || command include-what-you-use || \
+	  (echo "Could not find 'iwyu', exiting."; exit 1)
+	@command -v clang-tidy || command -v clang-tidy-16 || \
+	  (echo "Could not find 'clang-tidy'(-16), exiting."; exit 1)
 	cd build/Release &&\
-	cmake -S ../.. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake  -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release &&\
-	cmake -DCMAKE_VERBOSE_MAKEFILE --build .
+	  cmake -S ../.. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake  -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release &&\
+	  cmake --build .
+	# cmake --build . --verbose
 
 
 test-debug: build-debug
diff --git a/README.md b/README.md
index e1680f3..510518c 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,9 @@ Integration tests for linkahead-cpplib and the linkahead-server
 
 # Dependencies
 
-* clang-tidy
+* clang-tidy-16
 * clang-format
-* include-what-you-use
+* iwyu / include-what-you-use
 * cmake
 * conan
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4c10d0d..9fcfff0 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -80,7 +80,7 @@ if(LINTING)
             "-Xiwyu" "--cxx17ns")
     endif()
 
-    find_program(clang_tidy NAMES clang-tidy clang-tidy-11)
+    find_program(clang_tidy NAMES clang-tidy clang-tidy-16)
     if(NOT clang_tidy)
         message(WARNING "clang-tidy: Not found")
     else()
-- 
GitLab