|  | # 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/components.gni") | 
|  | import("//build/rust/rustc_library.gni") | 
|  |  | 
|  | rustc_library("fuchsia-hyper") { | 
|  | name = "fuchsia_hyper" | 
|  | edition = "2018" | 
|  | version = "0.1.0" | 
|  | with_unit_tests = true | 
|  | deps = [ | 
|  | "//src/lib/fuchsia-async", | 
|  | "//third_party/rust_crates:futures", | 
|  | "//third_party/rust_crates:hex", | 
|  | "//third_party/rust_crates:http", | 
|  | "//third_party/rust_crates:hyper", | 
|  | "//third_party/rust_crates:hyper-rustls", | 
|  | "//third_party/rust_crates:log", | 
|  | "//third_party/rust_crates:lru-cache", | 
|  | "//third_party/rust_crates:parking_lot", | 
|  | "//third_party/rust_crates:pin-project", | 
|  | "//third_party/rust_crates:rustls", | 
|  | "//third_party/rust_crates:tokio", | 
|  | ] | 
|  | test_deps = [ | 
|  | "//third_party/rust_crates:anyhow", | 
|  | "//third_party/rust_crates:assert_matches", | 
|  | "//third_party/rust_crates:rand", | 
|  | "//third_party/rust_crates:webpki", | 
|  | ] | 
|  | if (is_host) { | 
|  | deps += [ | 
|  | "//third_party/rust_crates:async-net", | 
|  | "//third_party/rust_crates:rustls-native-certs", | 
|  | "//third_party/rust_crates:tower-service", | 
|  | ] | 
|  | } else { | 
|  | deps += [ | 
|  | "//garnet/lib/rust/webpki-roots-fuchsia", | 
|  | "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", | 
|  | "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc", | 
|  | "//src/lib/fuchsia-component", | 
|  | "//src/lib/network/fidl_fuchsia_net_ext", | 
|  | "//src/lib/zircon/rust:fuchsia-zircon", | 
|  | "//src/sys/lib/fidl-connector", | 
|  | "//third_party/rust_crates:itertools", | 
|  | "//third_party/rust_crates:libc", | 
|  | "//third_party/rust_crates:socket2", | 
|  | ] | 
|  | test_deps += [ | 
|  | "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces-rustc", | 
|  | "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", | 
|  | "//src/lib/fidl/rust/fidl", | 
|  | "//src/lib/fuchsia", | 
|  | "//third_party/rust_crates:test-case", | 
|  | ] | 
|  | } | 
|  |  | 
|  | sources = [ | 
|  | "src/lib.rs", | 
|  | "src/session_cache.rs", | 
|  | ] | 
|  | if (is_host) { | 
|  | sources += [ "src/not_fuchsia.rs" ] | 
|  | } else { | 
|  | sources += [ | 
|  | "src/fuchsia.rs", | 
|  | "src/happy_eyeballs.rs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | configs -= [ "//build/config/rust:allow_unused_results" ] | 
|  | } | 
|  |  | 
|  | fuchsia_component("fuchsia-hyper-lib-test") { | 
|  | testonly = true | 
|  | manifest = "meta/fuchsia_hyper_lib_test.cmx" | 
|  | deps = [ ":fuchsia-hyper_test" ] | 
|  | } | 
|  |  | 
|  | fuchsia_test_package("fuchsia-hyper-tests") { | 
|  | test_components = [ ":fuchsia-hyper-lib-test" ] | 
|  | deps = [ "//src/connectivity/network/netstack:component-legacy" ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ | 
|  | ":fuchsia-hyper-tests", | 
|  | ":fuchsia-hyper_test($host_toolchain)", | 
|  | ] | 
|  | } |