Using bzlmod with Bazel 6 or later:
-
[Bazel 6] Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_cc", version = "0.2.0")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_cc",
sha256 = "ae244f400218f4a12ee81658ff246c0be5cb02c5ca2de5519ed505a6795431e9",
strip_prefix = "rules_cc-0.2.0",
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.0/rules_cc-0.2.0.tar.gz",
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")
rules_cc_dependencies()
rules_cc_toolchains()
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
compatibility_proxy_repo()
Full Changelog: 0.1.4...0.2.0