chapter09 - program analysis tools
说明
这一章节是作者将一些分析工具以函数或内置支持的形式自动化地加入到了 CMake 构建工程的过程中了。
格式化
clang-format
静态检查
- clang-tidy
- cpplint(按照 Google Coding Style 检查)
- cppcheck
- include-what-you-use
- link what you use(CMake 内置)
静态检查受到 CMake 的直接支持:
All we need to do is set an appropriate target property to a semicolon-separated list containing the path to the checker’s executable, followed by any command-line options that should be forwarded to the checker.
<LANG>_CLANG_TIDY
<LANG>_CPPCHECK
<LANG>_CPPLINT
<LANG>_INCLUDE_WHAT_YOU_USE
LINK_WHAT_YOU_USE