Tool for generating Clang JSON Compilation Database files for make-based build systems.
Low maintenance activity. Last release 20 months ago, commits in 3 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install compiledbCompilation Database Generator
Tool for generating Clang's JSON Compilation Database file for GNU
make-based build systems.
It's aimed mainly at non-cmake (cmake already generates compilation database)
large codebases. Inspired by projects like YCM-Generator and Bear,
but faster (mainly with large projects), since in most cases it doesn't need a clean
build (as the mentioned tools do) to generate the compilation database file, to
achieve this it uses the make options such as -n/--dry-run and -k/--keep-going
to extract the compile commands. Also, it's more cross-compiling friendly than
YCM-generator's fake-toolchanin approach.
Installation
# pip install compiledb
- Supports Python >= 3.3
- For bash completion support, add the content of
sh-completion/compiledb.bashfile to your.bashrcfile, for example.
Usage
compiledb provides a make python wrapper script which, besides to execute the make
build command, updates the JSON compilation database file corresponding to that build,
resulting in a command-line interface similar to Bear.
To generate compile_commands.json file using compiledb's "make wrapper" script,
executing Makefile target all:
$ compiledb make
compiledb forwards all the options/arguments passed after subcommand to GNU Make,
so one can, for example, generate using
as main makefile ( flag), starting the build from directory ( flag):