blob: 3700c181c9d8c31ca0734db919f31d7eb16cc0c2 [file] [log] [blame]
# 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.
# This file was generated by the `fx create` command. The template
# is located at `//tools/create/templates/component-v2/BUILD.gn.tmpl-rust`.
# If you find something broken, we are eager to review fixes.
import("//build/rust/rustc_binary.gni")
import("//src/session/build/session_config.gni")
import("//src/sys/build/components.gni")
session_config("hello-world-session-config.json") {
config = "meta/hello-world-session-config.json"
}
group("hello-world-session") {
testonly = true
deps = [
":package",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":hello-world-session-unittests" ]
}
rustc_binary("bin") {
name = "hello-world-session"
# Generates a GN target for unit-tests with the label `bin_test`, and
# a binary named `hello_world_session_bin_test`.
with_unit_tests = true
deps = [
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:anyhow",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("component") {
component_name = "hello-world-session"
manifest = "meta/hello-world-session.cml"
deps = [ ":bin" ]
}
fuchsia_package("package") {
package_name = "hello-world-session"
deps = [ ":component" ]
}
# Run with `fx test hello-world-session-unittests`.
fuchsia_unittest_package("hello-world-session-unittests") {
manifest = "meta/hello-world-session-unittests.cml"
deps = [ ":bin_test" ]
}