| # Copyright 2018 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/compiled_action.gni") |
| import("//build/fidl/toolchain.gni") |
| |
| # Declares a source_set for the coding tables of a FIDL library. |
| # |
| # Parameters |
| # |
| # * fidl_target |
| # - Required: The name of the associated fidl() target. |
| # - Type: string |
| # |
| # * testonly, visibility |
| # - Optional: Usual GN meanings. |
| # |
| template("fidl_tables") { |
| forward_variables_from(invoker, [ "fidl_target" ]) |
| coding_tables_target = ":${fidl_target}($fidl_toolchain)" |
| coding_tables = get_label_info(coding_tables_target, "target_gen_dir") + |
| "/${fidl_target}/c/$fidl_target.fidl.tables.c" |
| |
| # The C simple $type code is generated by the frontend, so we just need to |
| # produce a target with the generated file name and configuration information. |
| source_set(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "visibility", |
| ]) |
| |
| sources = [ coding_tables ] |
| |
| deps = [ coding_tables_target ] |
| public_deps = [ "//sdk/lib/fidl_base" ] |
| if (is_fuchsia) { |
| public_deps += [ "//zircon/public/sysroot:headers" ] |
| } else { |
| public_deps += [ "//src/zircon/lib/zircon:zircon-headers" ] |
| } |
| } |
| } |