blob: ca41a5e73d6c75505d559324cf28e5d5fe67be84 [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.
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//src/sys/build/components.gni")
group("starnix") {
deps = [ ":pkg" ]
}
if (target_cpu == "x64") {
rustc_binary("starnix_bin") {
name = "starnix"
edition = "2018"
with_unit_tests = true
source_root = "main.rs"
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/process_builder",
"//src/lib/syslog/rust:syslog",
"//src/lib/zerocopy",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:parking_lot",
]
sources = [
"executive.rs",
"loader.rs",
"main.rs",
"syscalls.rs",
"types.rs",
]
}
# Add this prebuilt binary to test locally.
#
# resource("hello_word") {
# sources = [ "fixtures/hello_world.bin" ]
# outputs = [ "bin/{{source_file_part}}" ]
# }
fuchsia_component("starnix_component") {
component_name = "starnix"
deps = [
# ":hello_word",
":starnix_bin",
]
manifest = "meta/starnix.cmx"
}
fuchsia_unittest_package("starnix-tests") {
manifest = "meta/starnix-tests.cmx"
deps = [ ":starnix_bin_test" ]
}
}
fuchsia_package("pkg") {
package_name = "starnix"
if (target_cpu == "x64") {
deps = [ ":starnix_component" ]
}
}
group("tests") {
testonly = true
if (target_cpu == "x64") {
deps = [ ":starnix-tests" ]
}
}