blob: 59c41415a9efce5d09c777cc97297706b68a105a [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/config/fuchsia/rules.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/fidl/fidl.gni")
import("//src/sys/build/components.gni")
group("driver_host2") {
deps = [
":bin",
":meta",
]
}
group("tests") {
testonly = true
deps = [ ":driver-host2-test" ]
}
source_set("lib") {
sources = [
"driver_host.cc",
"driver_host.h",
]
public_deps = [
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_llcpp",
"//src/devices/lib/driver2",
"//src/devices/lib/driver2:llcpp",
"//src/devices/lib/log",
"//zircon/public/lib/zxc",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/fs",
]
}
fidl("fuchsia.driverhost.test") {
testonly = true
sources = [ "driver_host.test.fidl" ]
}
driver_module("test_driver") {
testonly = true
sources = [ "driver_host_test_driver.cc" ]
deps = [
":fuchsia.driverhost.test_llcpp",
"//src/devices/lib/driver2",
"//src/devices/lib/driver2:llcpp",
"//zircon/system/ulib/svc",
]
}
driver_module("test_not_driver") {
testonly = 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",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
fuchsia_unittest_package("driver-host2-test") {
manifest = "meta/driver_host2_test.cml"
deps = [
":test_driver",
":test_not_driver",
":unittests",
]
}
executable("bin") {
output_name = "driver_host2"
sources = [ "main.cc" ]
deps = [
":lib",
"//src/sys/lib/stdout-to-debuglog/cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/svc",
"//zircon/system/ulib/syslog",
]
}
component_manifest_resources("meta") {
sources = [ "meta/driver_host2.cml" ]
}