https://github.com/cdump/bazel_compile_commands
https://github.com/cdump/bazel_compile_commands
bazel clangd compile-commands-json
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/cdump/bazel_compile_commands
- Owner: cdump
- License: apache-2.0
- Created: 2020-12-08T09:30:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-08T07:28:44.000Z (about 5 years ago)
- Last Synced: 2025-04-03T00:11:12.155Z (over 1 year ago)
- Topics: bazel, clangd, compile-commands-json
- Language: C++
- Homepage:
- Size: 124 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bazel-compile-commands
Generates [compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html) for your bazel project
## What is compile_commands.json
It's a file used by code completion tools, like [clangd](https://clangd.llvm.org/)
Look at [example.cpp](example/example.cpp) in vim with [coc-nvim](https://github.com/neoclide/coc.nvim) plugin with/without that database:

## How to use
See [example](example/)
With `--experimental_action_listener` we generate JSON files for every build piece and with `gen_compile_commands.sh` we make final `compile_commands.json`
## Acknowledgements
- based on [kythe/kythe](https://github.com/kythe/kythe/tree/33b83453a40fa6555cadaa2dab517d2c49510073/kythe/cxx/tools/generate_compile_commands)
- extra_actions_base.proto from [bazelbuild/bazel](https://github.com/bazelbuild/bazel/blob/df37047e4ec45f5d018b436dbb64062cd9148a15/src/main/protobuf/extra_actions_base.proto)