blob: c48a515de4c450fd04e2a62a569b3a5760af1158 [file] [log] [blame]
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# use the "--override_repository" argument to load a local sdk-integration repository for development.
# for example:
# tools/bazel build --config=fuchsia_x64 --override_repository=rules_fuchsia=<absolute_path_to>/sdk-integration/bazel_rules_fuchsia "target"
git_repository(
name = "rules_fuchsia",
remote = "https://fuchsia.googlesource.com/sdk-integration",
# TODO: use a release tag or a specific commit hash to ensure
# hermeciticy and reproductability.
branch = "main",
# use patch_cmds instead of strip_prefix because of https://github.com/bazelbuild/bazel/issues/10062
# we need to remove /tools before moving because there is a bazel_rules_fuchsia/tools directory
patch_cmds = ["rm -R tools", "mv bazel_rules_fuchsia/* ."],
)
load(
"@rules_fuchsia//fuchsia:deps.bzl",
"fuchsia_clang_repository",
"fuchsia_sdk_repository",
"rules_fuchsia_deps",
)
rules_fuchsia_deps()
# set an environment variable "BAZEL_FUCHSIA_SDK_ARCHIVE=" to use a local SDK tarball instead
# fetching from CIPD.
fuchsia_sdk_repository(
name = "fuchsia_sdk",
cipd_tag = "version:7.20220201.2.1",
sha256 = {
"linux": "cd27c5acd36f71a2c20c77d4ef8b16bd4bc4c8bab6f9f979b8c66183d6145df1",
"mac": "16a34eccf3b0e871aa4f40331ed14f40ff35ad190c93004a813361f9491bc5fa",
},
)
register_toolchains("@fuchsia_sdk//:fuchsia_toolchain_sdk")
fuchsia_clang_repository(
name = "fuchsia_clang",
cipd_tag = "git_revision:c9e46219f38da5c3fbfe41012173dc893516826e",
sdk_root_label = "@fuchsia_sdk",
sha256 = {
"linux": "573ebb62fc5cd9d2357be630cc079fa97b028cd99e2e87132dcd8be31c425984",
"mac": "fb9e478d18f35d0a9bb186138a85cf7ef5f9078fbf432fc3ad8f0660b233b3b4",
},
)
# Compilation database
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_grail_bazel_compdb",
sha256 = "d32835b26dd35aad8fd0ba0d712265df6565a3ad860d39e4c01ad41059ea7eda",
strip_prefix = "bazel-compilation-database-0.5.2",
urls = ["https://github.com/grailbio/bazel-compilation-database/archive/0.5.2.tar.gz"],
)
load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps")
bazel_compdb_deps()
load(
"@bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive"
)
http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip"],
strip_prefix = "googletest-609281088cfefc76f9d0ce82e1ff6c30cc3591e5",
sha256 = "5cf189eb6847b4f8fc603a3ffff3b0771c08eec7dd4bd961bfd45477dd13eb73",
patches = ["fuchsia_bazel.patch", "fuchsia_gtest.patch", ],
)