blob: fc1ff02a5111ca69a3f30e75d8f6df2fa8bfb3f0 [file] [log] [blame] [edit]
# 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/config.gni")
import("//src/sys/core/build/core_shard.gni")
import("fxbug_dev_90440.gni")
group("tests") {
testonly = true
deps = [ ":sshd-host-tests" ]
}
source_set("sshd_constants") {
sources = [ "constants.h" ]
}
source_set("lib") {
sources = [ "service.cc" ]
public_deps = [
"//sdk/fidl/fuchsia.boot",
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/sys/lib/chrealm",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/zx",
]
}
executable("bin") {
output_name = "sshd-host"
sources = [ "sshd-host.cc" ]
deps = [
":lib",
"//sdk/lib/fdio",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
fuchsia_component("cmx") {
component_name = "sshd-host"
manifest = "meta/sshd-host.cmx"
deps = [ ":bin" ]
}
fuchsia_component("cml") {
component_name = "sshd-host"
manifest = "meta/sshd-host.cml"
deps = [ ":bin" ]
# TODO(fxbug.dev/97903): remove the below after removing svc_from_sys from
# sshd-host.cml.
check_includes = false
}
fuchsia_package("sshd-host") {
deps = [
# Ensure this isn't included in production
"//build/validate:non_production_tag",
# Used by programs that need to load ICU locale data, such as tz-util.
"//src/intl:icudtl",
"//third_party/openssh-portable:hostkeygen",
"//third_party/openssh-portable:scp",
"//third_party/openssh-portable:sftp-server",
"//third_party/openssh-portable:sshd",
]
# TODO(fxbug.dev/90440): delete the below after we use cml everywhere
if (sshd_host_component == "cmx") {
deps += [
":cmx",
# Configure sysmgr to start sshd-host.cmx
"//src/sys/sysmgr:sshd_host_config",
]
} else if (sshd_host_component == "cml") {
deps += [ ":cml" ]
} else {
assert(false, "Invalid value sshd_host_component = $sshd_host_component")
}
}
core_shard("core_shard") {
shard_file = "meta/sshd-host.core_shard.cml"
}
config_data("config") {
for_pkg = "sshd-host"
sources = [ "//third_party/openssh-portable/fuchsia/sshd_config" ]
outputs = [ "sshd_config" ]
}
executable("test") {
testonly = true
output_name = "sshd-host-test"
sources = [ "test.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.boot",
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_package("sshd-host-tests") {
manifest = "meta/sshd-host-test.cml"
deps = [ ":test" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}