cpp-build-systems

Generate compile_commands.json for CMake, Meson, Make, and Bazel projects.

14|Updated May 28, 2026
One-click install
npx skills add https://github.com/Redtropig/harness-anchor --skill cpp-build-systems
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-build-systems
Source: https://github.com/Redtropig/harness-anchor/tree/main/skills/cpp-build-systems
Command: npx skills add https://github.com/Redtropig/harness-anchor --skill cpp-build-systems

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures C/C++ projects have a reliable, instrumented build configuration by guaranteeing the presence and correct wiring of compile_commands.json, enabling accurate tooling and analysis.

Core Features & Use Cases

  • Supports CMake, Meson, Make (Bear/compiledb), and Bazel workflows with clear guidance to export compile_commands.json.
  • Provides out-of-source build recommendations and tooling integration for clang-tidy, clangd, and IWYU.
  • Includes build-failure triage guidance and multi-config workflows for Debug/Release and sanitizer runs.

Quick Start

Configure your project with a modern build system (CMake or Meson) to generate compile_commands.json and start using tooling across your project.

Frequently Asked Questions about cpp-build-systems

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate compile_commands.json for CMake and Meson C++ projects?

To generate compile_commands.json for CMake or Meson, configure your project setup to export the compilation database into an out-of-source build directory. This ensures accurate tooling integration for clangd and clang-tidy across your C++ project.

Can I use Bear or compiledb to generate compile_commands.json for a Makefile project?

Yes, Bear and compiledb are supported workflows for generating compile_commands.json in Make-based C++ projects. This ensures your build configuration is reliably instrumented and wired to tooling like clang-tidy and IWYU.

How do I set up multi-config builds for Debug, Release, and sanitizer runs in C++?

To set up multi-config builds for Debug, Release, and sanitizer runs, use the pre-defined commands and workflows provided. This ensures reliable, reproducible C++ builds and proper tooling integration across different build configurations.

Why does clangd fail to find headers when my C++ build system is misconfigured?

clangd fails to find headers when compile_commands.json is missing or incorrectly wired to your build system. This Skill provides build-failure triage guidance to fix tooling integration issues and ensure accurate C++ code analysis.

Does this build tooling support Bazel C++ projects?

Yes, this build tooling supports Bazel C++ projects by providing clear guidance to export compile_commands.json. It covers setup, out-of-source builds, and tooling integration to ensure reliable, reproducible builds across supported systems.