| # 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("//build/fidl/fidl.gni") |
| |
| # This template simply defers to the `fidl` template widely used in the Fuchsia |
| # GN build. |
| template("fidl_library") { |
| main_target_name = target_name |
| |
| fidl(main_target_name) { |
| forward_variables_from(invoker, "*", [ "sdk" ]) |
| |
| name = string_replace(target_name, "-", ".") |
| |
| if (defined(invoker.sdk) && invoker.sdk) { |
| sdk_category = "partner" |
| |
| api = "//sdk/fidl/$name/$name.api" |
| } |
| } |
| |
| # The following targets provide mappings from ZN names for bindings flavors to |
| # the corresponding GN names. |
| |
| group("c") { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "visibility", |
| ]) |
| |
| public_deps = [ ":${main_target_name}_c" ] |
| } |
| |
| group("c.headers") { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "visibility", |
| ]) |
| |
| public_deps = [ ":${main_target_name}_c" ] |
| } |
| |
| group("llcpp") { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "visibility", |
| ]) |
| |
| public_deps = [ ":${main_target_name}_llcpp" ] |
| } |
| |
| group("llcpp.headers") { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "visibility", |
| ]) |
| |
| public_deps = [ ":${main_target_name}_llcpp" ] |
| } |
| } |