Skip to content

Commit 50efc36

Browse files
committed
Run clang-tidy on examples too
1 parent ae22641 commit 50efc36

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ endif()
3737

3838
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3939
if(CMAKE_EXPORT_COMPILE_COMMANDS)
40-
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
40+
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
41+
find_program(CLANG_TIDY_EXE NAMES clang-tidy clang-tidy-20 DOC "Path to clang-tidy executable")
4142
endif()
4243

4344
include(CMakePrintHelpers)
@@ -149,5 +150,9 @@ if(BEMAN_SCOPE_BUILD_TESTS)
149150
endif()
150151

151152
if(BEMAN_SCOPE_BUILD_EXAMPLES)
153+
if(CLANG_TIDY_EXE)
154+
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
155+
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-extra-arg=--Wno-error=unknown-argument")
156+
endif()
152157
add_subdirectory(examples)
153158
endif()

0 commit comments

Comments
 (0)