| # Copyright 2020 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/config/clang/clang.gni") |
| import("//build/fidl/toolchain.gni") |
| import("//build/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/host.gni") |
| import("//build/sdk/sdk_host_tool.gni") |
| import("//build/testing/golden_files.gni") |
| import("//tools/fidl/fidlc/testdata/info.gni") |
| |
| if (is_host) { |
| golden_files("fidlgen_hlcpp_golden_tests") { |
| testonly = true |
| |
| deps = [] |
| comparisons = [] |
| foreach(info, fidl_testdata_info) { |
| if (info.denylist + [ "fidlgen_hlcpp" ] - [ "fidlgen_hlcpp" ] == |
| info.denylist) { |
| deps += [ "${info.target}_hlcpp_generate($fidl_toolchain)" ] |
| _gen_dir = "${info.fidl_gen_dir}/${info.target_name}/hlcpp" |
| _include_path = string_replace(info.library, ".", "/") + "/cpp" |
| comparisons += [ |
| { |
| golden = "goldens/${info.name}.h.golden" |
| candidate = "$_gen_dir/$_include_path/fidl.h" |
| }, |
| { |
| golden = "goldens/${info.name}.cc.golden" |
| candidate = "$_gen_dir/$_include_path/fidl.cc" |
| }, |
| { |
| golden = "goldens/${info.name}_test_base.h.golden" |
| candidate = "$_gen_dir/$_include_path/fidl_test_base.h" |
| }, |
| { |
| golden = "goldens/${info.name}_tables.c.golden" |
| candidate = "$_gen_dir/$_include_path/tables.c" |
| }, |
| ] |
| } |
| } |
| } |
| } |
| |
| group("goldens") { |
| testonly = true |
| |
| denylist_key = "device_build_denylist" |
| if (is_host) { |
| denylist_key = "host_build_denylist" |
| } |
| |
| deps = [] |
| foreach(info, fidl_testdata_info) { |
| if (info[denylist_key] + [ "fidlgen_hlcpp" ] - [ "fidlgen_hlcpp" ] == |
| info[denylist_key]) { |
| deps += [ "${info.target}_hlcpp" ] |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fidlgen_hlcpp_golden_tests($host_toolchain)", |
| ":goldens", |
| ":goldens($host_toolchain)", |
| ] |
| } |
| |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## |
| # |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # |
| # AUTO-GENERATED - DO NOT EDIT |
| # |
| # The targets below are auto-generated based on the targets defined in the |
| # BUILD.bazel file from the same directory. If you made changes to targets in |
| # Bazel, instead of editing this file manually, run: |
| # |
| # > fx bazel2gn |
| # |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and |
| # rerun bazel2gn. |
| |
| import("//build/tools/bazel2gn/bazel_migration.gni") |
| |
| # A self-verification target for generated content in this file. |
| if (is_host) { |
| verify_bazel2gn("verify_bazel2gn") { |
| } |
| } |
| |
| if (is_host) { |
| sdk_go_binary_host_tool("fidlgen_hlcpp") { |
| sources = [ "main.go" ] |
| sdk_area = "FIDL" |
| category = "partner" |
| sdk_name = "fidlgen_hlcpp" |
| deps = [ |
| "//tools/fidl/fidlgen_hlcpp/codegen", |
| "//tools/fidl/fidlgen_hlcpp/coding_tables", |
| "//tools/fidl/lib/fidlgen_cpp", |
| ] |
| } |
| } |
| if (is_host) { |
| install_host_tools("host") { |
| deps = [ ":fidlgen_hlcpp" ] |
| outputs = [ "fidlgen_hlcpp" ] |
| } |
| } |