blob: debe009deabde61303da3a7232f086e2c9b9f7f8 [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.
workspace(name = "sdk-integration")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "platforms",
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
],
)
# Setup fuchsia rules
local_repository(
name = "fuchsia_sdk_common",
path = "../bazel_rules_fuchsia/common",
)
local_repository(
name = "fuchsia_workspace",
path = "../bazel_rules_fuchsia",
)
load(
"@fuchsia_workspace//fuchsia:deps.bzl",
"fuchsia_sdk_repository",
"rules_fuchsia_deps",
)
rules_fuchsia_deps()
fuchsia_sdk_repository(
name = "fuchsia_sdk",
)
register_toolchains("@fuchsia_sdk//:fuchsia_toolchain_sdk")
# Create the @fuchsia_build_config information to get host_tag information.
load("@fuchsia_sdk_common//:fuchsia_platform_build.bzl", "fuchsia_build_config_repository")
fuchsia_build_config_repository(
name = "fuchsia_build_config",
fuchsia_source_dir = "../../..",
)
load("@fuchsia_build_config//:defs.bzl", "build_config")
load(
"@fuchsia_sdk//fuchsia:clang.bzl",
"fuchsia_clang_repository",
)
fuchsia_clang_repository(
name = "fuchsia_clang",
local_path = "../../../prebuilt/third_party/clang/" + build_config.host_tag,
)
load("@fuchsia_clang//:defs.bzl", "register_clang_toolchains")
register_clang_toolchains()
# Register compact python runtime toolchain. This picks up the host
# python3 interpreter in the current PATH, and packages it in a way
# that allows sandboxes and remote builders to access / use it.
load(
"@fuchsia_sdk_common//:toolchains/python/repository_rule.bzl",
"compact_python_runtime_repository",
)
compact_python_runtime_repository(
name = "prebuilt_python",
)
register_toolchains("@prebuilt_python//:py_toolchain")
fuchsia_sdk_repository(
name = "fuchsia_sdk_x64_only",
local_paths = [
"sdk_generation/goldens/simple_idk_x64",
],
)
fuchsia_sdk_repository(
name = "fuchsia_sdk_arm64_only",
local_paths = [
"sdk_generation/goldens/simple_idk_arm64",
],
)
fuchsia_sdk_repository(
name = "fuchsia_sdk_both",
local_paths = [
"sdk_generation/goldens/simple_idk_both",
],
)
local_repository(
name = "fuchsia-infra-bazel-rules",
path = "../../../third_party/fuchsia-infra-bazel-rules/src",
)
new_local_repository(
name = "bazel",
build_file_content = """
# Copyright 2024 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.
filegroup(
name = "all_files",
srcs = glob(["**/*"]),
visibility = ["//visibility:public"],
)
""",
path = "../../../prebuilt/third_party/bazel/" + build_config.host_tag,
)
# gTest.
local_repository(
name = "com_google_googletest",
path = "../../../third_party/googletest/src",
)