blob: 3356c761dc6e39a67b8b4d4869b96c957d7e195d [file] [log] [blame]
cyya6a3a782019-02-07 22:27:33 +08001find_package(ClangTools QUIET)
2if(clang-tidy_FOUND AND run-clang-tidy_FOUND AND NOT TARGET do_run_clang_tidy)
3 add_custom_target(
4 do_run_clang_tidy
5 COMMAND ClangTools::run-clang-tidy -clang-tidy-binary "$<TARGET_FILE:ClangTools::clang-tidy>" -p ${CMAKE_BINARY_DIR} "-quiet" > ./run-clang-tidy.txt
6 DEPENDS ${CMAKE_BINARY_DIR}/compile_commands.json
7 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
8 )
9endif()