Support clang-tidy (#1034)
This commit is contained in:
@@ -534,3 +534,17 @@ if(SHERPA_ONNX_ENABLE_TESTS)
|
||||
sherpa_onnx_add_test(${source})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(srcs_to_check)
|
||||
foreach(s IN LISTS sources)
|
||||
list(APPEND srcs_to_check ${CMAKE_CURRENT_LIST_DIR}/${s})
|
||||
endforeach()
|
||||
|
||||
# For clang-tidy
|
||||
add_custom_target(
|
||||
clang-tidy-check
|
||||
clang-tidy -p ${CMAKE_BINARY_DIR}/compile_commands.json --config-file ${CMAKE_SOURCE_DIR}/.clang-tidy ${srcs_to_check}
|
||||
DEPENDS ${sources})
|
||||
|
||||
add_custom_target(check DEPENDS clang-tidy-check)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user