thrift/build/cmake/StaticCodeAnalysis.cmake
cyy a6a3a787ec THRIFT-4732:refine cmake scripts (#1688)
* add cmake support for clib and remove unused variables
* add targets for code analysis
* add wall to all compilers and add utf-8 options for msvc
2019-02-07 09:27:33 -05:00

10 lines
428 B
CMake

find_package(ClangTools QUIET)
if(clang-tidy_FOUND AND run-clang-tidy_FOUND AND NOT TARGET do_run_clang_tidy)
add_custom_target(
do_run_clang_tidy
COMMAND ClangTools::run-clang-tidy -clang-tidy-binary "$<TARGET_FILE:ClangTools::clang-tidy>" -p ${CMAKE_BINARY_DIR} "-quiet" > ./run-clang-tidy.txt
DEPENDS ${CMAKE_BINARY_DIR}/compile_commands.json
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()