Skip to content

Commit 5433fc1

Browse files
authored
Merge pull request #166 from darktohka/clang-tidy
Allow clang-tidy to be disabled during compilation
2 parents 489c57e + e8c3a5d commit 5433fc1

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,22 @@ include_directories(
8383

8484
# CLANG TIDY
8585

86-
find_program(
87-
CLANG_TIDY_EXE
88-
NAMES "clang-tidy"
89-
DOC "Path to clang-tidy executable"
90-
)
91-
if(NOT CLANG_TIDY_EXE)
92-
message(STATUS "clang-tidy not found.")
86+
option(USE_CLANG_TIDY "Use clang-tidy during compilation" ON)
87+
88+
if(USE_CLANG_TIDY)
89+
find_program(
90+
CLANG_TIDY_EXE
91+
NAMES "clang-tidy"
92+
DOC "Path to clang-tidy executable"
93+
)
94+
if(NOT CLANG_TIDY_EXE)
95+
message(STATUS "clang-tidy not found.")
96+
else()
97+
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
98+
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix" "-checks=*,-cert-err34-c,-readability-identifier-length,-altera-unroll-loops,-bugprone-easily-swappable-parameters,-concurrency-mt-unsafe,-*magic-numbers,-hicpp-signed-bitwise,-readability-function-cognitive-complexity,-altera-id-dependent-backward-branch,-google-readability-todo")
99+
endif()
93100
else()
94-
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
95-
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix" "-checks=*,-cert-err34-c,-readability-identifier-length,-altera-unroll-loops,-bugprone-easily-swappable-parameters,-concurrency-mt-unsafe,-*magic-numbers,-hicpp-signed-bitwise,-readability-function-cognitive-complexity,-altera-id-dependent-backward-branch,-google-readability-todo")
101+
message(STATUS "Not using clang-tidy.")
96102
endif()
97103

98104
# BUILD

0 commit comments

Comments
 (0)