| # Copyright 2018 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_binary("bin") { |
| name = "netstack3" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "core:netstack3-core", |
| "//garnet/lib/rust/ethernet", |
| "//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext", |
| "//garnet/lib/rust/fidl_fuchsia_net_ext", |
| "//garnet/lib/rust/never", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-syslog", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/lib/packet", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures-preview", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:rand", |
| "//zircon/public/fidl/fuchsia-hardware-ethernet:fuchsia-hardware-ethernet-rustc", |
| "//zircon/public/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/public/fidl/fuchsia-net:fuchsia-net-rustc", |
| "//zircon/public/fidl/fuchsia-net-stack:fuchsia-net-stack-rustc", |
| "//zircon/public/fidl/fuchsia-posix-socket:fuchsia-posix-socket-rustc", |
| ] |
| |
| test_deps = [ |
| "//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:network-rustc", |
| "//third_party/rust_crates:pin-utils", |
| ] |
| } |
| |
| package("netstack3") { |
| deps = [ |
| ":bin", |
| ] |
| |
| binaries = [ |
| { |
| name = "netstack3" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/netstack3.cmx") |
| dest = "netstack3.cmx" |
| }, |
| ] |
| } |
| |
| test_package("netstack3_tests") { |
| deps = [ |
| ":bin_test", |
| "core:netstack3-core_test", |
| "core/specialize-ip-macro/test:lib_test", |
| ] |
| tests = [ |
| { |
| name = "netstack3_bin_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack3_core_lib_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "specialize_ip_macro_test_lib_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |