| # 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/components/fuchsia_component.gni") |
| import("//build/components/fuchsia_package.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| rustc_binary("hello_world_v1") { |
| testonly = true |
| edition = "2021" |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("hello_world-component") { |
| testonly = true |
| component_name = "hello_world" |
| manifest = "meta/hello_world.cml" |
| deps = [ ":hello_world_v1" ] |
| } |
| |
| fuchsia_package("hello_world-package") { |
| testonly = true |
| package_name = "hello_world" |
| deps = [ ":hello_world-component" ] |
| } |
| |
| if (current_toolchain == target_toolchain) { |
| resource("meta_far") { |
| testonly = true |
| data_deps = [ ":hello_world-package" ] |
| sources = [ "$target_out_dir/hello_world-package/meta.far" ] |
| outputs = [ "data/assemblies/v1/hello_world/{{source_file_part}}" ] |
| } |
| } else { |
| group("meta_far") { |
| testonly = true |
| public_deps = [ ":meta_far($target_toolchain)" ] |
| } |
| } |