| # Copyright 2021 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| group("fidlgen_banjo") { |
| deps = [ ":bin($host_toolchain)" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "tests" ] |
| } |
| |
| rustc_binary("bin") { |
| edition = "2018" |
| |
| output_name = "fidlgen_banjo" |
| |
| sources = [ "src/main.rs" ] |
| |
| source_root = "src/main.rs" |
| |
| deps = [ |
| ":lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:structopt", |
| ] |
| } |
| |
| rustc_library("lib") { |
| edition = "2018" |
| |
| name = "fidlgen_banjo_lib" |
| |
| sources = [ |
| "src/backends/c.rs", |
| "src/backends/cpp.rs", |
| "src/backends/cpp_internal.rs", |
| "src/backends/cpp_mock.rs", |
| "src/backends/mod.rs", |
| "src/backends/rust.rs", |
| "src/backends/util.rs", |
| "src/fidl.rs", |
| "src/lib.rs", |
| ] |
| |
| inputs = [ |
| "src/backends/templates/c/body.h", |
| "src/backends/templates/c/callback.h", |
| "src/backends/templates/c/header.h", |
| "src/backends/templates/c/proto_transform.h", |
| "src/backends/templates/c/protocol_ops.h", |
| "src/backends/templates/c/protocol.h", |
| "src/backends/templates/c/struct.h", |
| "src/backends/templates/cpp/base_protocol.h", |
| "src/backends/templates/cpp/example.h", |
| "src/backends/templates/cpp/footer.h", |
| "src/backends/templates/cpp/header.h", |
| "src/backends/templates/cpp/interface.h", |
| "src/backends/templates/cpp/internal_decl.h", |
| "src/backends/templates/cpp/internal_protocol.h", |
| "src/backends/templates/cpp/internal_static_assert.h", |
| "src/backends/templates/cpp/internal.h", |
| "src/backends/templates/cpp/mock_expect.h", |
| "src/backends/templates/cpp/mock_header.h", |
| "src/backends/templates/cpp/mock.h", |
| "src/backends/templates/cpp/proto_transform.h", |
| "src/backends/templates/cpp/protocol.h", |
| "src/backends/templates/rust/body.rs", |
| "src/backends/templates/rust/enum.rs", |
| "src/backends/templates/rust/header.rs", |
| "src/backends/templates/rust/protocol.rs", |
| "src/backends/templates/rust/struct.rs", |
| "src/backends/templates/rust/union.rs", |
| ] |
| |
| source_root = "src/lib.rs" |
| |
| deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:heck", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| ] |
| } |