| # 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_host") { |
| deps = [ ":component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":driver-host2-test" ] |
| } |
| |
| source_set("driver") { |
| sources = [ |
| "driver.cc", |
| "driver.h", |
| "driver_client.cc", |
| "driver_client.h", |
| ] |
| |
| deps = [ |
| "//sdk/lib/driver/runtime:driver_runtime_env_cpp", |
| "//sdk/lib/fit", |
| "//src/devices/lib/log", |
| "//src/lib/driver_symbols:driver_symbols", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.driver.host:fuchsia.driver.host_cpp", |
| "//sdk/lib/async_patterns/cpp", |
| "//sdk/lib/driver/component/cpp:cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//zircon/system/ulib/async:async-cpp", |
| ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "driver_host.cc", |
| "driver_host.h", |
| ] |
| |
| public_deps = [ |
| ":driver", |
| "//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_cpp", |
| "//sdk/fidl/fuchsia.driver.host:fuchsia.driver.host_cpp", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/component/cpp:cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_env_cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/storage/lib/vfs/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| 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_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/driver/component/cpp:cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("test_driver") { |
| testonly = true |
| deps = [ ":test_driver_driver" ] |
| info = "test_driver-info.json" |
| manifest = "meta/test_driver.cml" |
| } |
| |
| 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" |
| manifest = "meta/test_not_driver.cml" |
| } |
| |
| executable("unittests") { |
| testonly = true |
| output_name = "driver_host_test" |
| |
| sources = [ "driver_host_test.cc" ] |
| |
| deps = [ |
| ":fuchsia.driverhost.test_cpp", |
| ":lib", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_env_cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_internal", |
| "//sdk/lib/inspect/testing/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", |
| ] |
| |
| # TODO(https://fxbug.dev/42176699): 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_host_test.cml" |
| deps = [ |
| ":test_driver", |
| ":test_not_driver", |
| ":unittests", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "driver_host" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_env", |
| "//sdk/lib/inspect/component/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/vfs/cpp", |
| "//src/devices/lib/log", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "driver_host" |
| manifest = "meta/driver_host.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component("next_component") { |
| component_name = "driver_host_next" |
| manifest = "meta/driver_host_next.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "driver_host" |
| deps = [ |
| ":component", |
| ":next_component", |
| ] |
| } |