| # 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/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| |
| go_library("fidlgen_cpp") { |
| deps = [ "//tools/fidl/lib/fidlgen" ] |
| sources = [ |
| "bits.go", |
| "clang_formatter.go", |
| "codegen_options.go", |
| "const.go", |
| "enum.go", |
| "handles.go", |
| "ir.go", |
| "name_transforms.go", |
| "names.go", |
| "namespace.go", |
| "namespaced_enum.go", |
| "protocol.go", |
| "service.go", |
| "struct.go", |
| "table.go", |
| "template_funcs.go", |
| "typed_channel_migration.go", |
| "union.go", |
| ] |
| } |
| |
| go_library("cpp_test") { |
| deps = [ |
| ":fidlgen_cpp", |
| "//third_party/golibs:github.com/google/go-cmp", |
| "//tools/fidl/lib/fidlgentest", |
| ] |
| sources = [ |
| "ir_test.go", |
| "name_transforms_test.go", |
| "names_test.go", |
| "namespaced_enum_test.go", |
| "protocol_test.go", |
| "testutils_test.go", |
| ] |
| } |
| |
| if (is_host) { |
| fidlc_target = "//tools/fidl/fidlc($host_toolchain)" |
| |
| host_test_data("copy_fidlc") { |
| sources = [ get_label_info(fidlc_target, "root_out_dir") + "/fidlc" ] |
| deps = [ fidlc_target ] |
| } |
| |
| go_test("fidlgen_cpp_ir_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/lib/fidlgen_cpp" ] |
| |
| fidlc_binary = get_label_info(fidlc_target, "root_out_dir") + "/fidlc" |
| args = [ |
| "--fidlc", |
| rebase_path(fidlc_binary, root_build_dir), |
| ] |
| |
| deps = [ ":cpp_test" ] |
| non_go_deps = [ ":copy_fidlc" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fidlgen_cpp_ir_test($host_toolchain)" ] |
| } |