diff --git a/README.rst b/README.rst index 3b2b661dc..9f1299321 100644 --- a/README.rst +++ b/README.rst @@ -88,27 +88,20 @@ Bazel To use glog within a project which uses the `Bazel `__ build tool, add the following lines to -your ``WORKSPACE`` file: +your ``MODULE`` file: .. code:: bazel - load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + bazel_dep(name = "glog") - http_archive( - name = "gflags", - sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf", - strip_prefix = "gflags-2.2.2", - urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"], + archive_override( + module_name = "glog", + urls = "https://github.com/google/glog/archive/cc0de6c200375b33d907ee7632eee2f173b33a09.tar.gz", + strip_prefix = "glog-cc0de6c200375b33d907ee7632eee2f173b33a09", # Latest commit as of 2024-06-08. + integrity = "sha256-rUrv4EBkdc+4Wbhfxp+KoRstlj2Iw842/OpLfDq0ivg=", ) - http_archive( - name = "com_github_google_glog", - sha256 = "122fb6b712808ef43fbf80f75c52a21c9760683dae470154f02bddfc61135022", - strip_prefix = "glog-0.6.0", - urls = ["https://github.com/google/glog/archive/v0.6.0.zip"], - ) - -You can then add :bazel:`@com_github_google_glog//:glog` to the deps section +You can then add :bazel:`@glog//:glog` to the deps section of a :bazel:`cc_binary` or :bazel:`cc_library` rule, and :code:`#include ` to include it in your source code. Here’s a simple example: @@ -117,7 +110,7 @@ to include it in your source code. Here’s a simple example: cc_binary( name = "main", srcs = ["main.cc"], - deps = ["@com_github_google_glog//:glog"], + deps = ["@glog//:glog"], ) CMake