blob: a1ff67bb10bbee570d7eea42d02ddd09954e7614 [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/components.gni")
import("//build/cpp/sdk_source_set.gni")
group("tests") {
testonly = true
deps = [ ":driver2-tests" ]
}
sdk_source_set("record") {
category = "experimental"
sdk_name = "driver2-record"
include_base = "//sdk"
sources = [ "record.h" ]
public_deps = [ "//sdk/lib/driver_runtime:driver_runtime" ]
}
sdk_source_set("devfs_exporter") {
category = "experimental"
sdk_name = "driver2_devfs_exporter"
include_base = "//sdk"
sources = [
"devfs_exporter.cc",
"devfs_exporter.h",
]
deps = [ ":cpp" ]
public_deps = [ "//sdk/fidl/fuchsia.device.fs:fuchsia.device.fs_cpp" ]
}
sdk_source_set("cpp") {
category = "experimental"
sdk_name = "driver2_cpp"
include_base = "//sdk"
sources = [
"driver2_cpp.h",
"driver_base.h",
"driver_context.cc",
"driver_context.h",
"handlers.h",
"logger.cc",
"logger.h",
"logger_internal.h",
"namespace.cc",
"namespace.h",
"node_add_args.cc",
"node_add_args.h",
"outgoing_directory.cc",
"outgoing_directory.h",
"record_cpp.h",
"service_client.h",
"start_args.h",
"structured_logger.h",
]
public_deps = [
":record",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//sdk/lib/fdio",
"//sdk/lib/fidl",
"//sdk/lib/fidl_driver:fidl_driver_transport",
"//sdk/lib/sys/component/cpp",
"//sdk/lib/syslog/structured_backend",
]
}
source_set("cpp-promise") {
sources = [
"promise.cc",
"promise.h",
]
public_deps = [
":cpp",
"//sdk/lib/fit-promise",
]
}
# TODO(fxbug.dev/109356): remove this once all users are migrated off
# v1 of runtime protocol discovery.
sdk_source_set("runtime-deprecated") {
category = "experimental"
sdk_name = "runtime-deprecated"
include_base = "//sdk"
sources = [
"runtime.h",
"runtime_connector_impl.cc",
"runtime_connector_impl.h",
]
visibility = [
"//sdk/lib/driver2:*",
"//src/devices/misc/drivers/compat:lib",
]
public_deps = [
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//sdk/lib/fdio",
"//sdk/lib/fidl",
"//sdk/lib/fidl_driver:fidl_driver_transport",
"//sdk/lib/sys/component/cpp",
"//sdk/lib/syslog/structured_backend",
]
}
executable("cpp_test") {
testonly = true
sources = [
"tests/devfs_exporter_test.cc",
"tests/logger_test.cc",
"tests/namespace_test.cc",
"tests/node_add_args_test.cc",
"tests/start_args_test.cc",
"tests/test_base.cc",
"tests/test_base.h",
]
deps = [
":cpp",
":devfs_exporter",
"//sdk/fidl/fuchsia.device.fs:fuchsia.device.fs_hlcpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_hlcpp",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//sdk/lib/fidl/cpp",
"//sdk/lib/sys/component/cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/diagnostics/lib/cpp-log-decoder:lib",
"//src/lib/diagnostics/accessor2logger",
"//src/lib/fsl",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//third_party/rapidjson",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/syslog",
]
# 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_component("driver2-cpp-test") {
manifest = "meta/cpp_test.cml"
deps = [ ":cpp_test" ]
}
fuchsia_test_package("driver2-tests") {
test_components = [ ":driver2-cpp-test" ]
}