| # 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/package.gni") |
| |
| rustc_library("dhcp") { |
| with_unit_tests = true |
| deps = [ |
| "//third_party/rust-crates/rustc_deps:byteorder", |
| "//third_party/rust-crates/rustc_deps:bytes", |
| ] |
| } |
| |
| rustc_binary("dhcpd_bin") { |
| source_root = "src/bin/dhcpd.rs" |
| deps = [ |
| ":dhcp", |
| "//garnet/public/rust/crates/fuchsia-async", |
| "//third_party/rust-crates/rustc_deps:failure", |
| "//third_party/rust-crates/rustc_deps:futures", |
| ] |
| } |
| |
| rustc_binary("fake_client_bin") { |
| source_root = "src/bin/fake_client.rs" |
| deps = [ |
| ":dhcp", |
| "//garnet/public/rust/crates/fuchsia-async", |
| "//third_party/rust-crates/rustc_deps:failure", |
| "//third_party/rust-crates/rustc_deps:futures", |
| ] |
| } |
| |
| package("dhcpd") { |
| deps = [ |
| ":dhcpd_bin", |
| ":fake_client_bin", |
| ] |
| binaries = [ |
| { |
| name = "dhcpd" |
| source = "rust_crates/dhcpd_bin" |
| }, |
| { |
| name = "fake_client" |
| source = "rust_crates/fake_client_bin" |
| } |
| ] |
| binary = "rust_crates/dhcpd_bin" |
| } |
| |
| package("dhcp_tests") { |
| testonly = true |
| deps = [ |
| ":dhcp", |
| ] |
| tests = [ |
| { name = "dhcp_lib_test_rustc" } |
| ] |
| } |