blob: 535168a57ce344768998c0deef118ae40189d427 [file] [log] [blame]
# 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")
driver_module("zxcrypt") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
sources = [
"device-info.cc",
"device-manager.cc",
"device.cc",
"extra.cc",
"worker.cc",
]
configs += [ "//build/config/fuchsia:integer-paranoia" ]
# Until library loading is fully async, dynamically linking libraries can
# deadlock block device drviers. All dependencies for zxcrypt should be
# static or already linked by the devhost. We consider libc, libzircon, and
# libdriver safe to depend on dynamically here.
deps = [
":bind",
"//sdk/banjo/fuchsia.hardware.block",
"//sdk/banjo/fuchsia.hardware.block.partition",
"//sdk/banjo/fuchsia.hardware.block.volume",
"//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted_c",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//src/security/fcrypto",
"//src/security/zxcrypt:zxcrypt-dev",
"//zircon/public/lib/bitmap",
"//zircon/public/lib/fbl",
"//zircon/public/lib/pretty",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/system/ulib/trace:trace-driver",
]
# Make sure we don't accidentally pull in a couple of easily-added dynamic
# library dependencies.
assert_no_deps = [
# This seems to get pulled in by //zircon/public/lib/driver, which is
# needed by //src/security/zxcrypt:zxcrypt-dev. But happily it doesn't show
# up in our dynamically-linked shared libraries, so we're okay.
#"//zircon/system/ulib/trace-engine",
# Some day, we'd also like to be able to assert we don't pull in fdio here,
# but it is pulled in transitively by //zircon/public/lib/driver, which is
# needed by //src/security/zxcrypt:zxcrypt-dev for the symbol
# |device_get_protocol|.
#"//sdk/lib/fdio",
"//src/security/zxcrypt:zxcrypt-fdio",
]
}
bind_rules("bind") {
disable_autobind = true
rules = "zxcrypt.bind"
output = "zxcrypt-bind.h"
deps = [ "//src/devices/bind/fuchsia.hardware.block" ]
}
bind_test("zxcrypt-bind-test") {
rules = "zxcrypt.bind"
tests = "bind-tests.json"
deps = [ "//src/devices/bind/fuchsia.hardware.block" ]
}
group("tests") {
testonly = true
deps = [ ":zxcrypt-bind-test" ]
}