Package: compiledb-plus
Compilation Database GeneratorTool for generatingClang's JSON Compilation Databasefile for GNUmake-based build systems.It's aimed mainly at non-cmake (cmake already generates compilation database)
large codebases. Inspired by projects likeYCM-GeneratorandBear,
but faster (mainly with large projects), since in most cases itdoesn'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-runand-k/--keep-goingto extract the compile commands. Also, it's morecross-compiling friendlythan
YCM-generator's fake-toolchanin approach.NoteThis project is a fork ofcompiledbmaintained
byNick Yamane. Since the PRs to the origin were pending and inactive for quite a long
time, here is an attempt to patch the origin project with this new package name calledcompiledb-plus.We express our gratitude to the original author(s) for their valuable contribution which made this fork possible. Any
issues, questions, or contributions pertaining to the additions in this fork should be directed to this repository, not
to the original author(s).Changes from OriginalSupport non-recursive makeInstallation# pip install compiledb-plusSupports Python 2.x and 3.x (for now, tested only with 2.7 and 3.6 versions)Usagecompiledb-plusprovides amakepython 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 toBear.To generatecompile_commands.jsonfile using compiledb-plus's "make wrapper" script,
executing Makefile targetall:$compiledb-plusmakecompiledb-plusforwards all the options/arguments passed aftermakesubcommand to GNU Make,
so one can, for example, generatecompile_commands.jsonusingcore/main.mkas main makefile (-fflag), starting the build frombuilddirectory (-Cflag):$compiledb-plusmake-fcore/main.mk-CbuildBy default,compiledb-plus makegenerates the compilation database and runs the actual build
command requested (acting as a make wrapper), the build step can be skipped using the-nor--no-buildoptions.$compiledb-plus-nmakecompiledb-plusbase command has been designed so that it can be used to parse compile commands
from arbitrary text files (or stdin), assuming it has a build log (ideally generated usingmake -Bnwkcommand), and generates the corresponding JSON Compilation database.For example, to generate the compilation database frombuild-log.txtfile, use the following
command.$compiledb-plus--parsebuild-log.txtor its equivalent:$compiledb-plus<build-log.txtOr even, to pipe make's output and print the compilation database to the standard output:$make-Bnwk|compiledb-plus-o-By defaultcompiledb-plusgenerates a JSON compilation database in the "arguments" listformat. The "command" string
format is also supported through the use of the--command-styleflag:$compiledb-plus--command-stylemakeTesting / ContributingI've implemented this tool because I needed to index someAOSP's modules for navigating
and studying purposes (after having no satisfatory results with current tools available by the
time such asYCM-GeneratorandBear). So I've reworked YCM-Generator, which resulted
in the initial version ofcompiledb/parser.pyand used successfully to generatecompile_commands.jsonfor some AOSP modules in ~1min running in aDockercontainer and then
could use it with some great tools, such as:Vim+YouCompleteMe+rtags+chromatica.nvimNeovim+LanguageClient-neovim+cquery+deopleteNeovim+ALE+cclsNotice:Windows: tested on Windows 10 with cmd, wsl(Ubuntu), mingw32Linux: tested only on Arch Linux and Ubuntu 18 so farMac: tested on macOS 10.13 and 10.14Patches are always welcome :)LicenseGNU GPLv3