blob: 9e562d5eb877b4b37457d755b86e58ac02ad9947 [file] [log] [blame]
# 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_library.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.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:http",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:hyper-rustls",
"//third_party/rust_crates:log",
"//third_party/rust_crates:rustls",
"//third_party/rust_crates:tokio",
]
if (is_host) {
deps += [
"//third_party/rust_crates:async-std",
"//third_party/rust_crates:rustls-native-certs-v0_3_0",
"//third_party/rust_crates:tower-service-v0_3_0",
"//third_party/rust_crates:webpki",
]
test_deps = [ "//third_party/rust_crates:anyhow" ]
} else {
deps += [
"//garnet/lib/rust/webpki-roots-fuchsia",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc",
"//src/lib/fuchsia-component",
"//src/lib/network/fidl_fuchsia_net_ext",
"//src/lib/tcp-stream-ext",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:socket2",
]
test_deps = [
"//src/lib/fidl/rust/fidl",
"//third_party/rust_crates:matches",
]
}
sources = [ "src/lib.rs" ]
if (is_host) {
sources += [ "src/not_fuchsia.rs" ]
} else {
sources += [ "src/fuchsia.rs" ]
}
}
test_package("fuchsia-hyper-tests") {
deps = [ ":fuchsia-hyper_test" ]
tests = [
{
name = "fuchsia_hyper_lib_test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
deps = [
":fuchsia-hyper-tests",
":fuchsia-hyper_test($host_toolchain)",
]
}