Skip to content

Generate compile_commands.json and run clang-tidy with Bazel

Notifications You must be signed in to change notification settings

zhoubowen-sky/bazel-compilation-db

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

bazel-compilation-db

Generate compile_commands.json and run clang-tidy with Bazel. This is an adaptation of Kythe's approach with a small patch to support the latest version of Bazel.

  1. Append WORKSPACE to your repository's WORKSPACE file.
  2. Copy third_party to your repository directory.
  3. Optionally replace 'kind(cc_.*, //...)' in third_party/tools/generate_compilation_database.sh.

To generate a compile_commands.json file in $(bazel info execution_root), run third_party/tools/generate_compilation_database.sh. To use clang-tidy, run third_party/tools/clang_tidy.sh.

Tested with Bazel 0.27.0.

About

Generate compile_commands.json and run clang-tidy with Bazel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%