Skip to content

Commit

Permalink
Merge pull request #215 from wazuh/change/214-clant-tidy-option
Browse files Browse the repository at this point in the history
Make clang-tidy Optional in Build Process
  • Loading branch information
vikman90 authored Oct 14, 2024
2 parents 7531019 + c67d5e8 commit d12caa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 3 additions & 1 deletion src/cmake/ConfigureTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d12caa6

Please sign in to comment.