blob: 9248cc945bd57d60b4c2912940837df9534f9bc5 [file]
# 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.
# [START imports]
load("//build/bazel/rules/cc:fx_cc_binary.bzl", "fx_cc_binary")
load(
"//build/bazel/rules/components:fx_component.bzl",
"fx_component",
"fx_component_manifest",
)
load("//build/bazel/rules/packages:fx_package.bzl", "fx_package")
load("//build/bazel/rules/packages:fx_packaged_binary.bzl", "fx_packaged_binary")
# [END imports]
package(default_applicable_licenses = ["//:license"])
# [START bin]
fx_cc_binary(
name = "bin",
srcs = ["main.cc"],
gn_output_name = "fidl_echo_cpp_client",
tags = ["manual"],
deps = [
"//examples/fidl/fuchsia.examples:fuchsia.examples_cpp",
# This library provides an asynchronous event loop implementation.
"//sdk/lib/async-loop:async-loop-cpp",
# This library is used to consume capabilities, e.g. protocols,
# from the component's incoming directory.
"//sdk/lib/component/incoming/cpp",
# This library is used to log messages.
"//sdk/lib/syslog/cpp",
],
)
# [END bin]
fx_packaged_binary(
name = "bin_packaged",
binary = ":bin",
binary_name = "fidl_echo_cpp_client",
)
# [START component]
fx_component_manifest(
name = "echo-client_manifest",
component_name = "echo_client",
includes = ["//sdk/lib/syslog:client.shard"],
manifest = "meta/client.cml",
)
fx_component(
name = "echo-client",
compiled_manifest = ":echo-client_manifest",
visibility = [
"//examples/fidl/cpp/server_async_completer:__pkg__",
"//examples/fidl/echo-realm:__pkg__",
],
deps = [":bin_packaged"],
)
# [END component]
# [START package]
# C++ async client and server example package
fx_package(
name = "echo-cpp-client",
components = [
":echo-client",
"//examples/fidl/cpp/server:echo-server",
"//examples/fidl/echo-realm:echo_realm",
],
visibility = ["//examples/fidl/cpp:__pkg__"],
)
# [END package]