| # 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_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/host.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| go_library("gopkg") { |
| name = "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_hlcpp/..." |
| deps = [ |
| "//garnet/go/src/fidl/compiler/backend/cpp", |
| "//garnet/go/src/fidl/compiler/backend/types", |
| ] |
| } |
| |
| go_binary("fidlgen_hlcpp") { |
| gopackage = "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_hlcpp" |
| |
| sdk_category = "partner" |
| deps = [ ":gopkg" ] |
| } |
| |
| install_host_tools("host") { |
| deps = [ ":fidlgen_hlcpp" ] |
| outputs = [ "fidlgen_hlcpp" ] |
| } |
| |
| # TODO(fxbug.dev/45483): Remove once all SDK customers are using HLCPP backend |
| # directly. |
| go_binary("fidlgen") { |
| gopackage = "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_hlcpp" |
| |
| sdk_category = "partner" |
| deps = [ ":gopkg" ] |
| } |
| |
| if (is_host) { |
| go_test("fidlgen_hlcpp_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_hlcpp/codegen" ] |
| args = [ |
| "--test_data_dir", |
| rebase_path("$root_out_dir/test_data/fidlgen", root_build_dir), |
| "--clang-format", |
| rebase_path("$root_out_dir/test_data/fidlgen_hlcpp", root_build_dir), |
| ] |
| deps = [ |
| ":gopkg", |
| "//garnet/go/src/fidl/compiler/backend/typestest", |
| ] |
| non_go_deps = [ ":clang_format" ] |
| } |
| |
| host_test_data("clang_format") { |
| sources = [ "//prebuilt/third_party/clang/$host_platform/bin/clang-format" ] |
| outputs = [ "$root_out_dir/test_data/fidlgen_hlcpp/{{source_file_part}}" ] |
| } |
| } |