diff --git a/BUILD.md b/BUILD.md index 657058edd2..0c0f1fb02d 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. diff --git a/src/cmake/ConfigureTarget.cmake b/src/cmake/ConfigureTarget.cmake index 96c89276d4..50cdbc7c89 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)