blob: 7eee0faaec327b6bf955c82b0378105ee56e0509 [file] [log] [blame]
# Copyright 2016 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/config.gni")
import("//src/sys/build/components.gni")
declare_args() {
# Whether the component loader should automatically update packages.
auto_update_packages = true
}
group("tests") {
testonly = true
deps = [
"integration_tests",
"test",
]
}
source_set("lib") {
sources = [
"app.cc",
"app.h",
"config.cc",
"config.h",
"package_updating_loader.cc",
"package_updating_loader.h",
]
public_deps = [
"//garnet/lib/loader",
"//garnet/public/lib/json",
"//sdk/fidl/fuchsia.hardware.power.statecontrol",
"//sdk/fidl/fuchsia.pkg",
"//sdk/lib/fidl/cpp",
"//sdk/lib/sys/cpp",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/lib/pkg_url",
"//zircon/system/ulib/async-loop:async-loop-cpp",
# TODO(fxbug.dev/57392): Move it back to //third_party once unification completes.
"//zircon/third_party/rapidjson",
]
if (auto_update_packages) {
public_configs = [ ":update_packages_config" ]
}
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
executable("bin") {
output_name = "sysmgr"
sources = [ "main.cc" ]
deps = [
":lib",
"//src/lib/fxl",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
fuchsia_component("sysmgr_component") {
manifest = "meta/sysmgr.cmx"
component_name = "sysmgr"
deps = [ ":bin" ]
}
fuchsia_package("sysmgr") {
deps = [ ":sysmgr_component" ]
}
template("cfg") {
config_data(target_name) {
for_pkg = "sysmgr"
sources = [ rebase_path("config/${invoker.name}") ]
}
}
cfg("network_config") {
name = "network.config"
}
cfg("services_config") {
name = "services.config"
}
cfg("router_config") {
name = "router.config"
}
config("update_packages_config") {
defines = [ "AUTO_UPDATE_PACKAGES" ]
}