Skip to content

Commit 845b2b7

Browse files
committed
core: target specific cmake clang-tidy
1 parent 06c8732 commit 845b2b7

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Checks: >
33
44
WarningsAsErrors: '*'
55

6-
HeaderFilterRegex: (^|.*/)(include/.*|source/.*)
6+
HeaderFilterRegex: '(include/.*|source/.*)'
77

88
CheckOptions:
99
# Private member variables

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1010
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
1111
if(CLANG_TIDY_EXE)
1212
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
13-
set(CMAKE_CXX_CLANG_TIDY
13+
set(CLANG_TIDY_COMMAND
1414
"${CLANG_TIDY_EXE}"
1515
"--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy"
1616
"--extra-arg-before=-Wno-unknown-warning-option"

test/0001_Basics/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ target_link_libraries(
2626
0001BASICS
2727
)
2828

29+
if(CLANG_TIDY_EXE)
30+
set_target_properties(0001BASICS PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
31+
endif()
2932

3033
include(GoogleTest)
3134
gtest_discover_tests(0001-Basics-Tests DISCOVERY_TIMEOUT 30)

0 commit comments

Comments
 (0)