| # Copyright 2026 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("@rules_cc//cc:cc_library.bzl", "cc_library") | |
| package( | |
| default_applicable_licenses = ["//:license"], | |
| default_visibility = ["//visibility:public"], | |
| ) | |
| cc_library( | |
| name = "interface", | |
| srcs = [ | |
| "block_device.cc", | |
| "reader_writer.cc", | |
| ], | |
| hdrs = [ | |
| "block_device.h", | |
| "reader_writer.h", | |
| ], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| "//src/storage/lib/block_protocol:block_fifo", | |
| "//src/storage/lib/buffer", | |
| "//zircon/system/ulib/fzl", | |
| "//zircon/third_party/ulib/safemath", | |
| "@fuchsia_sdk//pkg/zx", | |
| ] + select({ | |
| "//build/bazel/platforms:is_fuchsia_platform": [ | |
| "//sdk/fidl/fuchsia.storage.block:fuchsia.storage.block_cpp", | |
| ], | |
| "//conditions:default": [ | |
| "@fuchsia_sdk//fidl/fuchsia.storage.block:fuchsia.storage.block_cpp", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "cpp", | |
| srcs = [ | |
| "client.cc", | |
| "remote_block_device.cc", | |
| ], | |
| hdrs = [ | |
| "client.h", | |
| "pass_through_read_only_device.h", | |
| "remote_block_device.h", | |
| ], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| ":interface", | |
| "//src/storage/lib/block_protocol:block_fifo", | |
| "//src/storage/lib/buffer", | |
| "//zircon/third_party/ulib/safemath", | |
| "@fuchsia_sdk//pkg/zx", | |
| ] + select({ | |
| "//build/bazel/platforms:is_fuchsia_platform": [ | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", | |
| "//sdk/fidl/fuchsia.storage.block:fuchsia.storage.block_cpp", | |
| "//sdk/lib/fdio", | |
| ], | |
| "//conditions:default": [ | |
| "@fuchsia_sdk//fidl/fuchsia.io:fuchsia.io_cpp", | |
| "@fuchsia_sdk//fidl/fuchsia.storage.block:fuchsia.storage.block_cpp", | |
| "@fuchsia_sdk//pkg/fdio", | |
| ], | |
| }), | |
| ) |