3
3
## Bazel
4
4
5
5
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:
7
7
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 " )
10
10
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=" ,
23
16
)
24
17
```
25
18
26
- You can then add ` @com_github_google_glog //:glog ` to
19
+ You can then add ` @glog //:glog ` to
27
20
the deps section of a ` cc_binary ` or
28
21
` cc_library ` rule, and ` #!cpp #include <glog/logging.h> ` to
29
22
include it in your source code.
@@ -33,7 +26,7 @@ include it in your source code.
33
26
cc_binary(
34
27
name = "main",
35
28
srcs = [ "main.cc"] ,
36
- deps = [ "@com_github_google_glog //: glog "] ,
29
+ deps = [ "@glog //: glog "] ,
37
30
)
38
31
```
39
32
0 commit comments