| # Copyright 2019 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. |
| |
| import("//build/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| driver_module("core") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "block.core" |
| deps = [ |
| ":shared", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":block-core-bind_test", |
| ":core-unittest", |
| ] |
| } |
| |
| test("core-unittest-bin") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "blockcore" |
| include_dirs = [ "." ] |
| sources = [ |
| "test/main.cc", |
| "test/server.cc", |
| "test/stub-block-device.cc", |
| ] |
| deps = [ |
| ":shared", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//sdk/lib/fdio", |
| "//src/devices/testing/no_ddk", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/io-scheduler", |
| ] |
| } |
| |
| fuchsia_unittest_package("core-unittest") { |
| deps = [ ":core-unittest-bin" ] |
| } |
| |
| bind_rules("block-core-bind") { |
| rules = "block-core.bind" |
| output = "block-core-bind.h" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.hardware.block" ] |
| } |
| |
| source_set("shared") { |
| visibility = [ "./*" ] |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "block-device.cc", |
| "iobuffer.cc", |
| "manager.cc", |
| "message-group.cc", |
| "message.cc", |
| "server.cc", |
| ] |
| deps = [ |
| ":block-core-bind", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//sdk/banjo/fuchsia.hardware.block.partition", |
| "//sdk/banjo/fuchsia.hardware.block.volume", |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_c", |
| "//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_c", |
| "//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_c", |
| "//sdk/lib/syslog/cpp", |
| "//src/devices/lib/block", |
| "//src/devices/lib/dev-operation", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/storage-metrics", |
| ] |
| } |