| # 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.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_macro.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("starnix") { |
| deps = [ ":pkg" ] |
| if (target_cpu == "x64") { |
| deps += [ "//src/proc/bin/starnix/fixtures/hello_starnix:hello-starnix" ] |
| } |
| } |
| |
| if (target_cpu == "x64") { |
| rustc_binary("starnix_runner_bin") { |
| name = "starnix_runner" |
| edition = "2018" |
| with_unit_tests = true |
| |
| source_root = "main.rs" |
| deps = [ |
| ":starnix_macros", |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel-rustc", |
| "//sdk/fidl/fuchsia.starnix.developer:fuchsia.starnix.developer-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//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", |
| "//src/proc/lib/linux_uapi", |
| "//src/proc/lib/syncio", |
| "//src/sys/lib/library_loader", |
| "//src/sys/lib/runner", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:memchr", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| test_deps = [ "//garnet/lib/rust/io_util" ] |
| |
| sources = [ |
| "auth.rs", |
| "collections/mod.rs", |
| "collections/range_map.rs", |
| "fs/fd.rs", |
| "fs/fuchsia/mod.rs", |
| "fs/fuchsia/pipe.rs", |
| "fs/fuchsia/remote.rs", |
| "fs/fuchsia/syslog.rs", |
| "fs/mod.rs", |
| "loader.rs", |
| "logging.rs", |
| "main.rs", |
| "mm.rs", |
| "syscall_table.rs", |
| "syscalls.rs", |
| "task.rs", |
| "uapi.rs", |
| "user_address.rs", |
| ] |
| } |
| |
| fuchsia_component("starnix_runner_component") { |
| component_name = "starnix_runner" |
| deps = [ ":starnix_runner_bin" ] |
| manifest = "meta/starnix_runner.cml" |
| } |
| |
| fuchsia_unittest_package("starnix-tests") { |
| manifest = "meta/starnix-tests.cml" |
| deps = [ ":starnix_runner_bin_test" ] |
| } |
| } |
| |
| rustc_macro("starnix_macros") { |
| deps = [ |
| "//third_party/rust_crates:proc-macro2", |
| "//third_party/rust_crates:quote", |
| "//third_party/rust_crates:syn", |
| ] |
| source_root = "macro.rs" |
| sources = [ "macro.rs" ] |
| } |
| |
| fuchsia_component("starnix_manager") { |
| manifest = "meta/starnix_manager.cml" |
| } |
| |
| fuchsia_package("pkg") { |
| package_name = "starnix" |
| |
| deps = [ ":starnix_manager" ] |
| |
| if (target_cpu == "x64") { |
| deps += [ ":starnix_runner_component" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| if (target_cpu == "x64") { |
| deps = [ |
| ":starnix-tests", |
| "//src/proc/bin/starnix/fixtures/hello_starnix:hello-starnix-test", |
| ] |
| } |
| } |