bazel-contrib/rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)

Starlark

737

673 commits

updated Sep 23, 2026

See the code

README

rules_foreign_cc

Build status

Rules for building C/C++ projects using foreign build systems inside Bazel projects.

This is not an officially supported Google product (meaning, support and/or new releases may be limited.)

Documentation

Documentation for all rules and providers are available at the doc site

Version compatibility

bazel

The intent is to support the latest minor of all Active or Maintenance Bazel Versions. This generally means that older bazel versions may work, but they won't be tested and so they might break.

delegated build systems (e.g. cmake, ninja)

Some of these projects don't use semver, but the intent is is to support the logical equivalent of:

  • Latest version that is upstream-supported (meaning, they will accept patches for it)
    • If upstream will accept patches for multiple release branches, then the latest patch for each of those will be supported.
  • Exact version and latest patch version for supported LTS releases of distributions. The idea is that most packages only get tested with the versions in the distros, so these are the versions most likely to work.

News

For more generalized updates, please see NEWS.md or checkout the release notes of current or previous releases

Design document

External C/C++ libraries rules

Caveats

  • FreeBSD support is currently experimental and on a best-effort basis. Google currently doesn't have a CI test environment for FreeBSD, but please make your voice heard by upvoting this issue.
bazel
cmake
cmake-external
gnu-make
meson
ninja

Contributors

(top 30 of 102)

irengrig

186 commits

UebelAndre

149 commits

novas0x2a

98 commits

jheaff1

34 commits

bazel-contrib/rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)

Starlark

737

673 commits

updated Sep 23, 2026

See the code

README

rules_foreign_cc

Build status

Rules for building C/C++ projects using foreign build systems inside Bazel projects.

This is not an officially supported Google product (meaning, support and/or new releases may be limited.)

Documentation

Documentation for all rules and providers are available at the doc site

Version compatibility

bazel

The intent is to support the latest minor of all Active or Maintenance Bazel Versions. This generally means that older bazel versions may work, but they won't be tested and so they might break.

delegated build systems (e.g. cmake, ninja)

Some of these projects don't use semver, but the intent is is to support the logical equivalent of:

  • Latest version that is upstream-supported (meaning, they will accept patches for it)
    • If upstream will accept patches for multiple release branches, then the latest patch for each of those will be supported.
  • Exact version and latest patch version for supported LTS releases of distributions. The idea is that most packages only get tested with the versions in the distros, so these are the versions most likely to work.

News

For more generalized updates, please see NEWS.md or checkout the release notes of current or previous releases

Design document

External C/C++ libraries rules

Caveats

  • FreeBSD support is currently experimental and on a best-effort basis. Google currently doesn't have a CI test environment for FreeBSD, but please make your voice heard by upvoting this issue.
bazel
cmake
cmake-external
gnu-make
meson
ninja

Contributors

(top 30 of 102)

irengrig

186 commits

UebelAndre

149 commits

novas0x2a

98 commits

jheaff1

34 commits

Languages

Starlark

87.0%

Python

4.9%

Shell

4.4%

Go Template

2.6%