Skip to main content

Alternatives to Bear

Goal

Learn about the alternative tools that are available for generating compile_commands.json files

There are several tools available to generate the compile_commands.json file. We always recommend using the bear tool for this purpose. Please refer to the following quickstart guide with:
Compile Database Generation.

Note: An improved version of Bear is already provided in the Codee package (for Linux).

Here you can find a list of several alternatives available:

Build system / Meta-build systemC/C++FortranLinuxWindowsClarifications
CMake✔✔✔✔** Only when using the Ninja generator
Ninja✔✔✔✔
Fortran Package Manager✘✔✔✔
Scons✔✘*✔✔* DB file generation feature limited to C/C++
meson✔✔✔✔** Only when using the default Ninja generator
Bazel✔✘✔✔
ToolC/C++FortranLinuxWindowsDescription
Bear✔✔✔✘Intercepts build commands on the fly and generates the DB file
Clang Power Tools✔✘✘✔Visual Studio extension (limited to Clang compiler)

If none of the above works you could also try the following tools, although they are deprecated and without support for years: