blob: 5f558461c0102b101e1a4b4ee08676ff140b3f30 [file] [log] [blame]
# Copyright 2020 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/components.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/drivers.gni")
import("//build/fidl/fidl.gni")
group("driver_host2") {
deps = [ ":component" ]
}
group("tests") {
testonly = true
deps = [ ":driver-host2-test" ]
}
source_set("lib") {
sources = [
"driver_host.cc",
"driver_host.h",
]
public_deps = [
"//sdk/fidl/fuchsia.driver.host:fuchsia.driver.host_cpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/lib/driver2:llcpp",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//sdk/lib/driver_runtime:driver_runtime_internal_cpp",
"//sdk/lib/sys/component/cpp",
"//sdk/lib/syslog/cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/storage/vfs/cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/zxc",
]
}
fidl("fuchsia.driverhost.test") {
testonly = true
sources = [ "driver_host.test.fidl" ]
}
driver_bind_rules("bind") {
disable_autobind = true
}
fuchsia_driver("test_driver_driver") {
output_name = "test_driver"
testonly = true
sources = [ "driver_host_test_driver.cc" ]
deps = [
":bind",
":fuchsia.driverhost.test_llcpp",
"//sdk/lib/driver2:llcpp",
"//sdk/lib/sys/component/cpp",
"//src/devices/lib/driver:driver_runtime",
"//zircon/system/ulib/service:service-llcpp",
]
}
fuchsia_driver_component("test_driver") {
testonly = true
deps = [ ":test_driver_driver" ]
info = "test_driver-info.json"
colocate = true
}
fuchsia_driver("test_not_driver_driver") {
testonly = true
deps = [ ":bind" ]
output_name = "test_not_driver"
}
fuchsia_driver_component("test_not_driver") {
testonly = true
deps = [ ":test_not_driver_driver" ]
info = "test_not_driver-info.json"
colocate = true
}
executable("unittests") {
testonly = true
output_name = "driver_host2_test"
sources = [ "driver_host_test.cc" ]
deps = [
":fuchsia.driverhost.test_llcpp",
":lib",
"//sdk/fidl/fuchsia.io",
"//sdk/lib/driver_runtime:driver_runtime_internal",
"//sdk/lib/inspect/testing/cpp",
"//sdk/lib/sys/component/cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/fxl/test:gtest_main",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/service:service-llcpp",
]
# TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_unittest_package("driver-host2-test") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
manifest = "meta/driver_host2_test.cml"
deps = [
":test_driver",
":test_not_driver",
":unittests",
]
}
executable("bin") {
output_name = "driver_host2"
sources = [ "main.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.inspect:fuchsia.inspect_llcpp",
"//sdk/lib/driver_runtime:driver_runtime_internal",
"//sdk/lib/inspect/service/cpp",
"//sdk/lib/syslog/cpp",
"//sdk/lib/vfs/cpp",
"//src/sys/lib/stdout-to-debuglog/cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/service:service-llcpp",
]
}
fuchsia_component("component") {
component_name = "driver_host2"
manifest = "meta/driver_host2.cml"
deps = [ ":bin" ]
}