David Park

Using Ninja directly with -t compdb

· build, tooling, ninja

You can use Ninja’s built-in tool to generate the compile_commands.json.

$ ninja -t compdb > compile_commands.json
  • -t compdb tells Ninja to output the compilation database.
  • Redirect the output to compile_commands.json.