| # Copyright 2025 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/idk:idk_cc_source_library.bzl", "idk_cc_source_library") |
| |
| package(default_applicable_licenses = ["//:license"]) |
| |
| # The base library that supports domain objects. |
| # |
| # It works on host and Fuchsia. |
| idk_cc_source_library( |
| name = "cpp_base", |
| srcs = [ |
| "natural_coding_traits.cc", |
| "natural_decoder.cc", |
| "natural_encoder.cc", |
| "natural_types.cc", |
| ], |
| hdrs = [ |
| "include/lib/fidl/cpp/box.h", |
| "include/lib/fidl/cpp/internal/framework_err.h", |
| "include/lib/fidl/cpp/internal/natural_types.h", |
| "include/lib/fidl/cpp/natural_coding_traits.h", |
| "include/lib/fidl/cpp/natural_decoder.h", |
| "include/lib/fidl/cpp/natural_encoder.h", |
| "include/lib/fidl/cpp/natural_types.h", |
| "include/lib/fidl/cpp/wire_natural_conversions.h", |
| ], |
| api_area = "FIDL", |
| build_as_static = True, |
| category = "partner", |
| # TODO(https://fxbug.dev/42055960): Rename SDK element to "fidl_cpp_base". |
| idk_name = "fidl_cpp_base_v2", |
| implementation_deps = ["//sdk/lib/fidl_base"], |
| public_configs = [":cpp_base.headers"], |
| stable = True, |
| # In Bazel, the library must be visible to the package containing the symbolic macro. |
| # In GN, the library must be visible to any path that defines a `fidl()` target. |
| visibility = [ |
| "//build/bazel/rules/fidl:__subpackages__", |
| ], # @bazel2gn:raw_overwrite:[ "//*" ] |
| deps = [ |
| "//sdk/lib/fidl/cpp/wire", |
| "//sdk/lib/stdcompat", |
| "//zircon/system/ulib/zx", |
| ], |
| ) |
| |
| # The IPC library that adds messaging APIs on top of domain objects. |
| # |
| # It is Fuchsia-only. |
| idk_cc_source_library( |
| name = "cpp", |
| srcs = [ |
| "any_error_in.cc", |
| "internal/natural_message_encoder.cc", |
| ], |
| hdrs = [ |
| "include/lib/fidl/cpp/any_error_in.h", |
| "include/lib/fidl/cpp/channel.h", |
| "include/lib/fidl/cpp/client.h", |
| "include/lib/fidl/cpp/internal/channel_endpoint_conversions.h", |
| "include/lib/fidl/cpp/internal/client_details.h", |
| "include/lib/fidl/cpp/internal/make_response_context.h", |
| "include/lib/fidl/cpp/internal/natural_client_base.h", |
| "include/lib/fidl/cpp/internal/natural_message_encoder.h", |
| "include/lib/fidl/cpp/internal/thenable.h", |
| "include/lib/fidl/cpp/unified_messaging.h", |
| "include/lib/fidl/cpp/unified_messaging_declarations.h", |
| ], |
| api_area = "FIDL", |
| build_as_static = True, |
| category = "partner", |
| # TODO(https://fxbug.dev/42055960): Rename SDK element to "fidl_cpp". |
| idk_name = "fidl_cpp_v2", |
| stable = True, |
| target_compatible_with = ["@platforms//os:fuchsia"], |
| # In Bazel, the library must be visible to the package containing the symbolic macro. |
| # In GN, the library must be visible to any path that defines a `fidl()` target. |
| visibility = [ |
| "//build/bazel/rules/fidl:__subpackages__", |
| ], # @bazel2gn:raw_overwrite:[ "//*" ] |
| deps = [ |
| ":cpp_base", |
| "//sdk/lib/async", |
| "//sdk/lib/fidl_base", |
| ], |
| ) |
| |
| # The support header for HLCPP / Natural conversion |
| idk_cc_source_library( |
| name = "hlcpp_conversion", |
| hdrs = ["include/lib/fidl/cpp/hlcpp_conversion.h"], |
| api_area = "FIDL", |
| category = "partner", |
| idk_name = "fidl_cpp_hlcpp_conversion", |
| public_configs = [":cpp_base.headers"], |
| stable = True, |
| # In Bazel, the library must be visible to the package containing the symbolic macro. |
| # In GN, the library must be visible to any path that defines a `fidl()` target. |
| visibility = [ |
| "//build/bazel/rules/fidl:__subpackages__", |
| ], # @bazel2gn:raw_overwrite:[ "//*" ] |
| deps = [":cpp_base"], |
| ) |
| |
| # The support header for Natural type printing |
| idk_cc_source_library( |
| name = "natural_ostream", |
| hdrs = ["include/lib/fidl/cpp/natural_ostream.h"], |
| api_area = "FIDL", |
| category = "partner", |
| idk_name = "fidl_cpp_natural_ostream", |
| public_configs = [":cpp_base.headers"], |
| stable = True, |
| # In Bazel, the library must be visible to the package containing the symbolic macro. |
| # In GN, the library must be visible to any path that defines a `fidl()` target. |
| visibility = [ |
| "//build/bazel/rules/fidl:__subpackages__", |
| ], # @bazel2gn:raw_overwrite:[ "//*" ] |
| deps = [":cpp_base"], |
| ) |