blob: f9b6506cc6432ad6e0039fdfc57c0d12875f382e [file]
# 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/components.gni")
import("//build/test.gni")
executable("nand-util") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [
"aml.cc",
"commands.cc",
"ftl.cc",
"main.cc",
]
deps = [
":common",
"//sdk/fidl/fuchsia.hardware.nand:fuchsia.hardware.nand_c",
"//sdk/lib/fdio",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/pretty",
"//zircon/system/ulib/zx",
"//zircon/third_party/ulib/cksum",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
source_set("common") {
visibility = [ ":*" ]
sources = [
"ftl_internal.cc",
"nand-broker.cc",
]
deps = [ "//zircon/system/ulib/pretty" ]
public_deps = [
"//sdk/fidl/fuchsia.device:fuchsia.device_c",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.hardware.nand:fuchsia.hardware.nand_c",
"//sdk/fidl/fuchsia.nand:fuchsia.nand_c",
"//sdk/lib/fdio",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("nand-util-test-bin") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
output_name = "nand-util-test"
sources = [ "test/ftl_internal_test.cc" ]
include_dirs = [ "." ]
deps = [
":common",
"//sdk/lib/fdio",
"//zircon/system/ulib/zxtest",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_unittest_package("nand-util-test") {
deps = [ ":nand-util-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [ ":nand-util-test" ]
}