| # Copyright 2019 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("$zx_build/public/gn/migrated_targets.gni") |
| if (zx == "/") { |
| import("$zx/public/gn/fidl/params.gni") |
| } else { |
| import("//build/fidl/args.gni") |
| zx_fidl_trace_level = fidl_trace_level |
| } |
| |
| config("fidl-tracing-config") { |
| defines = [ "FIDL_TRACE_LEVEL=$zx_fidl_trace_level" ] |
| } |
| |
| # Base library used by both Fuchsia and host |
| zx_library("fidl_base") { |
| sdk = "source" |
| sdk_publishable = true |
| host = true |
| sdk_headers = [ |
| "lib/fidl/coding.h", |
| "lib/fidl/txn_header.h", |
| "lib/fidl/cpp/builder.h", |
| "lib/fidl/cpp/message.h", |
| "lib/fidl/cpp/message_buffer.h", |
| "lib/fidl/cpp/message_builder.h", |
| "lib/fidl/cpp/message_part.h", |
| "lib/fidl/internal.h", |
| "lib/fidl/internal_callable_traits.h", |
| "lib/fidl/trace.h", |
| "lib/fidl/visitor.h", |
| "lib/fidl/walker.h", |
| ] |
| sdk_migrated = true |
| |
| sources = [ |
| "builder.cc", |
| "decoding_and_validating.cc", |
| "encoding.cc", |
| "formatting.cc", |
| "handle_close_many.cc", |
| "internal.c", |
| "message.cc", |
| "message_buffer.cc", |
| "message_builder.cc", |
| "txn_header.c", |
| "validate_string.cc", |
| "walker.cc", |
| ] |
| deps = [ |
| "$zx/system/ulib/fit", |
| "$zx/system/ulib/zircon", |
| ] |
| |
| all_dependent_configs = [ ":fidl-tracing-config" ] |
| } |
| |
| zx_library("fidl") { |
| sdk = "source" |
| sdk_publishable = true |
| sdk_headers = [ "lib/fidl/epitaph.h" ] |
| sdk_migrated = true |
| sources = [ |
| "epitaph.c", |
| "handle_closing.cc", |
| ] |
| deps = [ |
| ":fidl_base", |
| "$zx/system/ulib/zircon", |
| ] |
| public_deps = [ ":fidl_base" ] |
| } |
| |
| if (is_fuchsia) { |
| zx_library("fidl-llcpp") { |
| sdk = "source" |
| sdk_headers = [ |
| "lib/fidl/llcpp/aligned.h", |
| "lib/fidl/llcpp/allocator.h", |
| "lib/fidl/llcpp/array.h", |
| "lib/fidl/llcpp/async_binding.h", |
| "lib/fidl/llcpp/async_transaction.h", |
| "lib/fidl/llcpp/buffer_allocator.h", |
| "lib/fidl/llcpp/buffer_then_heap_allocator.h", |
| "lib/fidl/llcpp/client_base.h", |
| "lib/fidl/llcpp/client.h", |
| "lib/fidl/llcpp/coding.h", |
| "lib/fidl/llcpp/connect_service.h", |
| "lib/fidl/llcpp/decoded_message.h", |
| "lib/fidl/llcpp/encoded_message.h", |
| "lib/fidl/llcpp/envelope.h", |
| "lib/fidl/llcpp/errors.h", |
| "lib/fidl/llcpp/failover_allocator.h", |
| "lib/fidl/llcpp/heap_allocator.h", |
| "lib/fidl/llcpp/memory.h", |
| "lib/fidl/llcpp/message.h", |
| "lib/fidl/llcpp/message_storage.h", |
| "lib/fidl/llcpp/result.h", |
| "lib/fidl/llcpp/server.h", |
| "lib/fidl/llcpp/service_handler_interface.h", |
| "lib/fidl/llcpp/string_view.h", |
| "lib/fidl/llcpp/sync_call.h", |
| "lib/fidl/llcpp/tracking_ptr.h", |
| "lib/fidl/llcpp/traits.h", |
| "lib/fidl/llcpp/transaction.h", |
| "lib/fidl/llcpp/types.h", |
| "lib/fidl/llcpp/unowned_ptr.h", |
| "lib/fidl/llcpp/unsafe_buffer_allocator.h", |
| "lib/fidl/llcpp/vector_view.h", |
| ] |
| sdk_migrated = true |
| sources = [ |
| "llcpp_async_binding.cc", |
| "llcpp_async_transaction.cc", |
| "llcpp_client_base.cc", |
| "llcpp_coding.c", |
| "llcpp_message.cc", |
| "llcpp_server.cc", |
| "llcpp_transaction.cc", |
| ] |
| public_deps = [ |
| ":headers", |
| |
| # <lib/fidl/llcpp/async_binding.h> has #include <lib/async/dispatcher.h> |
| "$zx/system/ulib/async:headers", |
| |
| # <lib/fidl/llcpp/client_base.h> has #include <fbl/intrusive_wavl_tree.h> |
| "$zx/system/ulib/fbl:headers", |
| |
| # <lib/fidl/llcpp/sync_call.h> has #include <lib/fit/result.h>. |
| # <lib/fidl/llcpp/types.h> has #include <lib/fit/function.h> |
| "$zx/system/ulib/fit:headers", |
| |
| # <lib/fidl/llcpp/async_binding.h> has #include <lib/sync/completion.h> |
| "$zx/system/ulib/sync:headers", |
| |
| # <lib/fidl/llcpp/traits.h> has #include <lib/zx/object.h>. |
| "$zx/system/ulib/zx:headers", |
| ] |
| deps = [ |
| ":fidl", |
| "$zx/system/ulib/async", |
| "$zx/system/ulib/fbl", |
| "$zx/system/ulib/fit", |
| "$zx/system/ulib/sync", |
| "$zx/system/ulib/zircon", |
| ] |
| } |
| } else { |
| zx_library("fidl-llcpp") { |
| host = true |
| sdk = "source" |
| sdk_headers = [ |
| "lib/fidl/llcpp/aligned.h", |
| "lib/fidl/llcpp/allocator.h", |
| "lib/fidl/llcpp/array.h", |
| "lib/fidl/llcpp/buffer_allocator.h", |
| "lib/fidl/llcpp/buffer_then_heap_allocator.h", |
| "lib/fidl/llcpp/coding.h", |
| "lib/fidl/llcpp/envelope.h", |
| "lib/fidl/llcpp/failover_allocator.h", |
| "lib/fidl/llcpp/memory.h", |
| "lib/fidl/llcpp/server.h", |
| "lib/fidl/llcpp/string_view.h", |
| "lib/fidl/llcpp/tracking_ptr.h", |
| "lib/fidl/llcpp/traits.h", |
| "lib/fidl/llcpp/unowned_ptr.h", |
| "lib/fidl/llcpp/unsafe_buffer_allocator.h", |
| "lib/fidl/llcpp/vector_view.h", |
| ] |
| sdk_migrated = true |
| sources = [ |
| "llcpp_coding.c", |
| "llcpp_message.cc", |
| ] |
| public_deps = [ "$zx/system/ulib/zircon:headers" ] |
| deps = [ |
| ":fidl_base", |
| "$zx/system/ulib/fbl", |
| "$zx/system/ulib/fit", |
| "$zx/system/ulib/zircon", |
| ] |
| } |
| } |