bazelbuild / rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
https://bazelbuild.github.io/rules_foreign_cc
Apache License 2.0
649 stars 232 forks source link

No bzlmod example #1130

Open louwers opened 6 months ago

louwers commented 6 months ago

The setup guide only explains how to use rules_foreign_cc with WORKSPACE, not with bzlmod.

https://bazelbuild.github.io/rules_foreign_cc/main/index.html#setup

louwers commented 6 months ago

OK that is actually super easy. Would still be good to mention it in the Setup guide!

attilaolah commented 6 months ago

It is indeed quite easy to use rules_foreign_cc from MODULE.bazel, however, it comes with some limitations, namely you don't have much control over which toolchains are registered — you get the defaults. For example, if you want to avoid using the built tools, currently your only option is to use a workspace file, as far as I'm aware.