| # 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/fidl/fidl.gni") |
| import("//build/testing/environments.gni") |
| import("//src/camera/debug.gni") |
| |
| group("device_watcher") { |
| deps = [ ":camera_device_watcher" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":camera_device_watcher_unittest" ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "device_instance.cc", |
| "device_instance.h", |
| "device_watcher_impl.cc", |
| "device_watcher_impl.h", |
| ] |
| |
| public_deps = [ |
| ":fuchsia.camera.test", |
| "//sdk/fidl/fuchsia.camera2.hal", |
| "//sdk/fidl/fuchsia.camera3", |
| "//sdk/fidl/fuchsia.hardware.camera", |
| "//sdk/fidl/fuchsia.io", |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/fit-promise", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fsl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| |
| defines = [ camera_debug_define ] |
| } |
| |
| executable("camera_device_watcher_bin") { |
| sources = [ "main.cc" ] |
| deps = [ ":lib" ] |
| defines = [ camera_debug_define ] |
| } |
| |
| fidl("fuchsia.camera.test") { |
| sdk_category = "internal" |
| sources = [ "device_watcher_tester.test.fidl" ] |
| public_deps = [ "//sdk/fidl/fuchsia.hardware.camera" ] |
| } |
| |
| fuchsia_package_with_single_component("camera_device_watcher") { |
| manifest = "meta/camera_device_watcher.cml" |
| deps = [ ":camera_device_watcher_bin" ] |
| } |
| |
| executable("camera_device_watcher_unittest_bin") { |
| testonly = true |
| sources = [ "device_watcher_unittest.cc" ] |
| deps = [ |
| ":fuchsia.camera.test", |
| ":lib", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/storage/vfs/cpp", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("camera_device_watcher_unittest") { |
| manifest = "meta/camera_device_watcher_unittest.cml" |
| deps = [ |
| ":camera_device_watcher", |
| ":camera_device_watcher_unittest_bin", |
| ] |
| test_specs = { |
| environments = [ sherlock_env ] |
| } |
| } |