Using Pigweed in an existing Bazel project#

This guide explains how to start using Pigweed in your existing Bazel-based C or C++ project. We’ll assume you’re familiar with the build system at the level of the Bazel tutorial.

Setup

Add Pigweed as an external dependency and configure the required Bazel flags.

Use Pigweed modules

Use Pigweed modules in an existing project.

Static and runtime analysis

Improve your project’s code quality by enabling static analysis and runtime sanitizers.

Supported Bazel versions#

Pigweed uses Bazel 8 features like platform-based flags, and so not all of Pigweed works with Bazel 7. We strongly recommend mirroring Pigweed’s current Bazel version pin:

8.1.0