| # Copyright 2026 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. | |
| load("//build/bazel/rules/cc:fx_cc_binary.bzl", "fx_cc_binary") | |
| load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library") | |
| load("//build/bazel/rules/cc:fx_cc_test_binary.bzl", "fx_cc_test_binary") | |
| load("//build/bazel/rules/packages:fx_package.bzl", "fx_package") | |
| load( | |
| "//build/bazel/rules/packages:fx_packaged_binary.bzl", | |
| "fx_packaged_binary", | |
| ) | |
| load("//build/bazel/rules/testing:fx_unittest_package.bzl", "fx_unittest_package") | |
| package(default_applicable_licenses = ["//:license"]) | |
| fx_cc_library( | |
| name = "debug_client", | |
| srcs = ["debug_client.cc"], | |
| hdrs = ["debug_client.h"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.camera2.debug:fuchsia.camera2.debug_hlcpp", | |
| "//sdk/fidl/fuchsia.camera2.hal:fuchsia.camera2.hal_hlcpp", | |
| "//sdk/fidl/fuchsia.hardware.camera:fuchsia.hardware.camera_cpp", | |
| "//sdk/fidl/fuchsia.hardware.camera:fuchsia.hardware.camera_hlcpp", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/component/incoming/cpp", | |
| "//sdk/lib/syslog/cpp", | |
| ], | |
| ) | |
| fx_cc_binary( | |
| name = "camera_sensor_cli_bin", | |
| srcs = ["main.cc"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| ":debug_client", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/sys/cpp", | |
| "//sdk/lib/syslog/cpp", | |
| "//src/lib/fxl:fxl_cli", | |
| ], | |
| ) | |
| fx_packaged_binary( | |
| name = "camera_sensor_cli_packaged_bin", | |
| binary = ":camera_sensor_cli_bin", | |
| binary_name = "camera_sensor_cli_bin", | |
| ) | |
| fx_package( | |
| name = "camera_sensor_cli", | |
| resources = [":camera_sensor_cli_packaged_bin"], | |
| ) | |
| fx_cc_test_binary( | |
| name = "camera_sensor_cli_unittest_bin", | |
| srcs = ["debug_client_unittest.cc"], | |
| tags = ["manual"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| ":debug_client", | |
| "//sdk/fidl/fuchsia.camera2.debug:fuchsia.camera2.debug_cpp", | |
| "//sdk/fidl/fuchsia.hardware.camera:fuchsia.hardware.camera_cpp", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/async_patterns/testing/cpp", | |
| "//sdk/lib/component/incoming/cpp", | |
| "//sdk/lib/component/outgoing/cpp", | |
| "//src/lib/fxl/test:gtest_main", | |
| "@com_google_googletest//:gtest", | |
| ], | |
| ) | |
| # StartHandlesMissingControllerDevice logs an error when no controller device is | |
| # available. | |
| fx_unittest_package( | |
| name = "camera_sensor_cli_test", | |
| max_log_severity = "ERROR", | |
| unit_tests = [":camera_sensor_cli_unittest_bin"], | |
| ) |