This repository demonstrates various ways to generate a compilation database for a C++ project. It serves as a test project to check compatibility with compilation database tools, such as different Clang tools.
To generate the compilation database in the raw
directory, simply run raw/tools/generate_compilation_database.sh
. The output will be placed in the raw/out
directory.
In the bazel
directory, you'll find a simple Bazel project. There are two methods to generate the compilation database:
This script utilizes grailbio/bazel-compilation-database under the hood and adjusts the output paths to be relative to the project's root directory. The bazel
project is already set up to use the grailbio/bazel-compilation-database
tool.
kiron1/bazel-compile-commands is a tool that generates a compilation database from Bazel without requiring modifications to the project's BUILD files. Build the tool and run it in the bazel
directory.