| # 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", |
| ] |
| configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| 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/ddk.protocol.block", |
| "//sdk/banjo/ddk.protocol.block.partition", |
| "//sdk/banjo/ddk.protocol.block.volume", |
| "//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted_c", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//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/zircon-crypto:zircon-crypto-static", |
| ] |
| |
| # 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", |
| "//zircon/system/ulib/zircon-crypto", |
| |
| # 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" ] |
| } |