blob: 27876e8a7acf219f078cad656fe73260786ab3e8 [file] [log] [blame]
# Copyright 2021 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/cpp/sdk_source_set.gni")
# The base library that supports domain objects.
#
# It works on host and Fuchsia.
sdk_source_set("cpp_base") {
category = "partner"
# TODO(https://fxbug.dev/42055960): Rename SDK element to "fidl_cpp_base".
api = "fidl_cpp_base_v2.api"
sdk_name = "fidl_cpp_base_v2"
# TODO(https://fxbug.dev/42172264): We should represent the library as a
# `sdk_static_library` when supported.
build_as_static = true
public = [
"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",
]
sources = [
"natural_coding_traits.cc",
"natural_decoder.cc",
"natural_encoder.cc",
"natural_types.cc",
]
public_deps = [
"//sdk/lib/fidl/cpp/wire",
"//sdk/lib/stdcompat",
"//zircon/system/ulib/zx",
]
deps = [ "//sdk/lib/fidl_base" ]
public_configs = [ ":cpp_base.headers" ]
}
config("cpp_base.headers") {
include_dirs = [ "include" ]
}
# The IPC library that adds messaging APIs on top of domain objects.
#
# It is Fuchsia-only.
if (is_fuchsia) {
sdk_source_set("cpp") {
category = "partner"
stable = true
# TODO(https://fxbug.dev/42055960): Rename SDK element to "fidl_cpp".
api = "fidl_cpp_v2.api"
sdk_name = "fidl_cpp_v2"
# TODO(https://fxbug.dev/42172264): We should represent the library as a
# `sdk_static_library` when supported.
build_as_static = true
public = [
"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",
]
sources = [
"any_error_in.cc",
"internal/natural_message_encoder.cc",
]
public_deps = [
"//sdk/lib/fidl_base",
"//src/lib/fidl/cpp:cpp_base",
"//zircon/system/ulib/async",
]
}
}
# The support header for HLCPP / Natural conversion
sdk_source_set("hlcpp_conversion") {
category = "partner"
stable = true
api = "fidl_cpp_hlcpp_conversion.api"
sdk_name = "fidl_cpp_hlcpp_conversion"
public = [ "include/lib/fidl/cpp/hlcpp_conversion.h" ]
public_configs = [ ":cpp_base.headers" ]
public_deps = [
"//sdk/lib/fidl/cpp:cpp_base",
"//src/lib/fidl/cpp:cpp_base",
]
}
# The support header for Natural type printing
sdk_source_set("natural_ostream") {
category = "partner"
stable = true
api = "fidl_cpp_natural_ostream.api"
sdk_name = "fidl_cpp_natural_ostream"
public = [ "include/lib/fidl/cpp/natural_ostream.h" ]
public_deps = [ "//src/lib/fidl/cpp:cpp_base" ]
public_configs = [ ":cpp_base.headers" ]
}