The bazelboost project is an attempt to build Boost modules as Bazel modules. This is the bazel registry for bazelboost.
To use the bazelboost registry add it to your projects .bazelrc
file.
# make sure bzlmod is enabled
common --enable_bzlmod
# add bazelboost registry
common --registry=https://raw.githubusercontent.com/bazelboost/registry/main
# by adding the bazelboost registry the BCR gets removed so you must add it here as well
common --registry=https://bcr.bazel.build
Now all the bazelboost modules may be added to your projects MODULE.bazel
file.
module(name = "my_project")
bazel_dep(name = "boost.asio", version = "1.83.0.bzl.X") # replace 'X' with latest version
All bazelboost modules have a target at the root with the same name as the module. For most cases you simple can use the module like so:
cc_library(
name = "my_library",
# ...
deps = [
# ...
"@boost.asio",
],
)
Some modules may have multiple targets. Review the BUILD.bazel
file(s) or use bazel query
to find out whats available.
bazel query 'kind(cc_.*, @boost.test//...)'
@boost.test//:boost.test
@boost.test//:cpp_main
@boost.test//:test_main
@boost.test//:unit_test_main
If a feature is missing please file an issue in the bazelboost module.
Each repository in the bazelboost org maintains a bazelboost-*
branch for each version it supports. At this time we're limiting support to 1.83.0
until everything is relatively stable. No source file modifications are permitted, only Bazel-related files may be added.