Skip to content

Commit 570c7e4

Browse files
authored
docs: update to Bzlmod usage (#1099)
1 parent 45f99f5 commit 570c7e4

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

docs/build.md

+10-17
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,20 @@
33
## Bazel
44

55
To use glog within a project which uses the [Bazel](https://bazel.build/) build
6-
tool, add the following lines to your `WORKSPACE` file:
6+
tool, add the following lines to your `MODULE.bazel` file:
77

8-
``` bazel title="WORKSPACE"
9-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
8+
``` bazel title="MODULE.bazel"
9+
bazel_dep(name = "glog")
1010

11-
http_archive(
12-
name = "gflags",
13-
sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
14-
strip_prefix = "gflags-2.2.2",
15-
urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"],
16-
)
17-
18-
http_archive(
19-
name = "com_github_google_glog",
20-
sha256 = "c17d85c03ad9630006ef32c7be7c65656aba2e7e2fbfc82226b7e680c771fc88",
21-
strip_prefix = "glog-0.7.1",
22-
urls = ["https://github.com/google/glog/archive/v0.7.1.zip"],
11+
archive_override(
12+
module_name = "glog",
13+
urls = "https://github.com/google/glog/archive/cc0de6c200375b33d907ee7632eee2f173b33a09.tar.gz",
14+
strip_prefix = "glog-cc0de6c200375b33d907ee7632eee2f173b33a09", # Latest commit as of 2024-06-08.
15+
integrity = "sha256-rUrv4EBkdc+4Wbhfxp+KoRstlj2Iw842/OpLfDq0ivg=",
2316
)
2417
```
2518

26-
You can then add `@com_github_google_glog//:glog` to
19+
You can then add `@glog//:glog` to
2720
the deps section of a `cc_binary` or
2821
`cc_library` rule, and `#!cpp #include <glog/logging.h>` to
2922
include it in your source code.
@@ -33,7 +26,7 @@ include it in your source code.
3326
cc_binary(
3427
name = "main",
3528
srcs = ["main.cc"],
36-
deps = ["@com_github_google_glog//:glog"],
29+
deps = ["@glog//:glog"],
3730
)
3831
```
3932

0 commit comments

Comments
 (0)