xref: /aosp_15_r20/external/fmtlib/support/bazel/README.md (revision 5c90c05cd622c0a81b57953a4d343e0e489f2e08)
1# Bazel support
2
3To get [Bazel](https://bazel.build/) working with {fmt} you can copy the files `BUILD.bazel`,
4`MODULE.bazel`, `WORKSPACE.bazel`, and `.bazelversion` from this folder (`support/bazel`) to the root folder of this project.
5This way {fmt} gets bazelized and can be used with Bazel (e.g. doing a `bazel build //...` on {fmt}).
6
7## Using {fmt} as a dependency
8
9### Using Bzlmod
10
11The [Bazel Central Registry](https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/fmt) provides support for {fmt}.
12
13For instance, to use {fmt} add to your `MODULE.bazel` file:
14
15```
16bazel_dep(name = "fmt", version = "10.2.1")
17```
18
19### Live at head
20
21For a live-at-head approach, you can copy the contents of this repository and move the Bazel-related build files to the root folder of this project as described above and make use of `local_path_override`, e.g.:
22
23```
24local_path_override(
25    module_name = "fmt",
26    path = "../third_party/fmt",
27)
28```
29