blob: 58a0cb8b55541a0c8747acf1b3c7604da62b4733 [file] [log] [blame]
# Copyright 2019 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/components.gni")
import("//build/fidl/fidl.gni")
import("//build/rust/rustc_binary.gni")
fidl("fidl") {
name = "examples.calculator"
sources = [ "calculator.fidl" ]
excluded_checks = [ "wrong-prefix-for-platform-source-library" ]
enable_rust_next = true
}
rustc_binary("bin") {
name = "calculator"
edition = "2021"
with_unit_tests = true
deps = [
":fidl_rust_next",
"//src/lib/fidl/rust_next/fidl_next",
"//src/lib/fuchsia-async",
]
if (is_fuchsia) {
deps += [ "//sdk/rust/zx" ]
}
sources = [ "src/main.rs" ]
}
fuchsia_component("component") {
component_name = "rust_next_calculator"
manifest = "meta/rust_next_calculator.cml"
deps = [ ":bin" ]
}
fuchsia_package("rust_next_calculator") {
deps = [ ":component" ]
}
fuchsia_unittest_package("rust_next_calculator_unittests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [
":bin_test($host_toolchain)",
":rust_next_calculator_unittests",
]
}