From ec8cf75709d02e6ab76938cfe6c501868dc0fbe6 Mon Sep 17 00:00:00 2001 From: Vikman Fernandez-Castro Date: Sun, 13 Oct 2024 13:37:39 +0200 Subject: [PATCH 1/2] build: add CMakeLists option to enable clang-tidy --- src/cmake/ConfigureTarget.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmake/ConfigureTarget.cmake b/src/cmake/ConfigureTarget.cmake index 96c89276d4d..50cdbc7c894 100644 --- a/src/cmake/ConfigureTarget.cmake +++ b/src/cmake/ConfigureTarget.cmake @@ -37,7 +37,9 @@ function(configure_target target) target_compile_options(${target} PRIVATE ${msvc_warnings}) endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + option(ENABLE_CLANG_TIDY "Enable clang-tidy analysis" ON) + + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND ENABLE_CLANG_TIDY) find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy-18) if(CLANG_TIDY_EXECUTABLE) From c67d5e872f9e91bb9f13becccdd633f84a2a3c09 Mon Sep 17 00:00:00 2001 From: Vikman Fernandez-Castro Date: Mon, 14 Oct 2024 09:11:56 +0200 Subject: [PATCH 2/2] docs: add `ENABLE_CLANG_TIDY` to BUILD.md --- BUILD.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BUILD.md b/BUILD.md index 657058edd27..0c0f1fb02d4 100644 --- a/BUILD.md +++ b/BUILD.md @@ -68,6 +68,13 @@ The following dependencies are required for this project: ctest --test-dir build --output-log build ``` +### Options + +|Option|Description|Default| +|---|---|---| +|`BUILD_TESTS`|Enable tests compilation|| +|`ENABLE_CLANG_TIDY`|Check code with _clang-tidy_|`ON`| + ## Notes - The project uses `vcpkg` as a submodule to manage dependencies. By initializing the submodules, `vcpkg` will automatically fetch the necessary dependencies when running CMake.