From 951df6a4964692eed38f267fcd3e3c6b569c8b92 Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 28 Mar 2019 00:52:04 -0700 Subject: [PATCH] Add skylib dependency [Copybara import of https://github.com/bazelbuild/rules_cc/pull/10] Skylib will be used to check minimum supported Bazel version. Merge 2e5b5eb2d04a7a87970f6441c5b782e0954bea14 into 3723b4c35f361ba5593d00c1f4183b387402fef5 PiperOrigin-RevId: 240725578 --- WORKSPACE | 3 +++ cc/deps.bzl | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 cc/deps.bzl diff --git a/WORKSPACE b/WORKSPACE index 89d6c08..b9fc89b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -80,3 +80,6 @@ http_archive( load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") go_rules_dependencies() go_register_toolchains() + +load("//cc:deps.bzl", "rules_cc_deps") +rules_cc_deps() diff --git a/cc/deps.bzl b/cc/deps.bzl new file mode 100644 index 0000000..7134dd6 --- /dev/null +++ b/cc/deps.bzl @@ -0,0 +1,17 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def rules_cc_deps(): + _maybe( + http_archive, + name = "bazel_skylib", + sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e", + strip_prefix = "bazel-skylib-0.8.0", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz", + ], + ) + +def _maybe(repo_rule, name, **kwargs): + if name not in native.existing_rules(): + repo_rule(name = name, **kwargs)