blob: fd95136e6cc89d49fa393005e2925d560bbaee3f [file] [log] [blame]
# Copyright 2018 The Chromium OS 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("//common-mk/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":capture_packets",
":cups_uri_helper",
":debugd",
":debugd-adaptors",
":debugd_dbus_utils",
":dev_features_chrome_remote_debugging",
":dev_features_password",
":dev_features_rootfs_verification",
":dev_features_ssh",
":dev_features_usb_boot",
":external-proto",
":generate_logs",
":icmp",
":libdebugd",
":netif",
":network_status",
":scheduler_configuration_helper",
]
if (use.test) {
deps += [ ":debugd_testrunner" ]
}
}
pkg_config("target_defaults") {
defines = [
"USE_CELLULAR=${use.cellular}",
"USE_IWLWIFI_DUMP=${use.iwlwifi_dump}",
"USE_TPM=${use.tpm}",
]
pkg_deps = [
"dbus-1",
"libbrillo",
"libchrome-${libbase_ver}",
"libcryptohome-client",
"liblzma",
"libminijail",
"vboot_host",
]
}
proto_library("external-proto") {
proto_in_dir = "${sysroot}/usr/include/chromeos/dbus/cryptohome"
proto_out_dir = "include"
sources = [
"${proto_in_dir}/key.proto",
"${proto_in_dir}/rpc.proto",
]
}
generate_dbus_adaptors("debugd-adaptors") {
dbus_service_config = "dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/debugd/dbus_adaptors"
sources = [ "dbus_bindings/org.chromium.debugd.xml" ]
}
pkg_config("libdebugd_dependent_config") {
pkg_deps = [ "libshill-client" ]
}
static_library("libdebugd") {
configs += [ ":target_defaults" ]
all_dependent_configs = [ ":libdebugd_dependent_config" ]
sources = [
"src/battery_tool.cc",
"src/constants.cc",
"src/container_tool.cc",
"src/crash_sender_tool.cc",
"src/cros_healthd_tool.cc",
"src/cups_tool.cc",
"src/debug_logs_tool.cc",
"src/debug_mode_tool.cc",
"src/debugd_dbus_adaptor.cc",
"src/dev_features_tool.cc",
"src/dev_mode_no_owner_restriction.cc",
"src/example_tool.cc",
"src/helper_utils.cc",
"src/icmp_tool.cc",
"src/ipaddrs_tool.cc",
"src/log_tool.cc",
"src/memory_tool.cc",
"src/netif_tool.cc",
"src/network_status_tool.cc",
"src/oom_adj_tool.cc",
"src/packet_capture_tool.cc",
"src/perf_tool.cc",
"src/ping_tool.cc",
"src/probe_tool.cc",
"src/process_with_id.cc",
"src/process_with_output.cc",
"src/route_tool.cc",
"src/sandboxed_process.cc",
"src/scheduler_configuration_tool.cc",
"src/session_manager_proxy.cc",
"src/shill_scripts_tool.cc",
"src/simple_service_tool.cc",
"src/storage_tool.cc",
"src/subprocess_tool.cc",
"src/swap_tool.cc",
"src/sysrq_tool.cc",
"src/systrace_tool.cc",
"src/tracepath_tool.cc",
"src/u2f_tool.cc",
"src/variant_utils.cc",
"src/verify_ro_tool.cc",
"src/wifi_fw_dump_tool.cc",
"src/wifi_power_tool.cc",
]
deps = [
":debugd-adaptors",
":external-proto",
]
}
static_library("debugd_dbus_utils") {
configs += [ ":target_defaults" ]
sources = [
"src/helpers/shill_proxy.cc",
"src/helpers/system_service_proxy.cc",
]
}
pkg_config("debugd_config") {
pkg_deps = [ "protobuf" ]
}
executable("debugd") {
configs += [
":debugd_config",
":target_defaults",
]
sources = [ "src/main.cc" ]
deps = [ ":libdebugd" ]
}
executable("capture_packets") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/capture_packets.cc" ]
libs = [ "pcap" ]
}
executable("cups_uri_helper") {
configs += [ ":target_defaults" ]
sources = [
"src/helpers/cups_uri_helper.cc",
"src/helpers/cups_uri_helper_utils.cc",
]
}
executable("dev_features_chrome_remote_debugging") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/dev_features_chrome_remote_debugging.cc" ]
deps = [ ":libdebugd" ]
}
executable("dev_features_password") {
configs += [ ":target_defaults" ]
sources = [
"src/helpers/dev_features_password.cc",
"src/helpers/dev_features_password_utils.cc",
]
deps = [ ":libdebugd" ]
}
executable("dev_features_rootfs_verification") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/dev_features_rootfs_verification.cc" ]
libs = [ "rootdev" ]
deps = [ ":libdebugd" ]
}
executable("dev_features_ssh") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/dev_features_ssh.cc" ]
deps = [ ":libdebugd" ]
}
pkg_config("dev_features_usb_boot_config") {
pkg_deps = [ "vboot_host" ]
}
executable("dev_features_usb_boot") {
configs += [
":dev_features_usb_boot_config",
":target_defaults",
]
sources = [ "src/helpers/dev_features_usb_boot.cc" ]
deps = [ ":libdebugd" ]
}
executable("generate_logs") {
configs += [ ":target_defaults" ]
sources = [ "tools/generate_logs.cc" ]
}
executable("icmp") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/icmp.cc" ]
}
executable("netif") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/netif.cc" ]
deps = [ ":debugd_dbus_utils" ]
}
executable("network_status") {
configs += [ ":target_defaults" ]
sources = [ "src/helpers/network_status.cc" ]
deps = [ ":debugd_dbus_utils" ]
}
executable("scheduler_configuration_helper") {
configs += [ ":target_defaults" ]
sources = [
"src/helpers/scheduler_configuration_helper.cc",
"src/helpers/scheduler_configuration_utils.cc",
]
}
if (use.test) {
pkg_config("debugd_testrunner_config") {
pkg_deps = [
"libchrome-test-${libbase_ver}",
"protobuf",
]
}
executable("debugd_testrunner") {
configs += [
"//common-mk:test",
":debugd_testrunner_config",
":target_defaults",
]
sources = [
"src/crash_sender_tool_test.cc",
"src/dev_mode_no_owner_restriction_test.cc",
"src/helper_utils_test.cc",
"src/helpers/cups_uri_helper_test.cc",
"src/helpers/cups_uri_helper_utils.cc",
"src/helpers/dev_features_password_utils.cc",
"src/helpers/dev_features_password_utils_test.cc",
"src/helpers/scheduler_configuration_utils.cc",
"src/helpers/scheduler_configuration_utils_test.cc",
"src/log_tool_test.cc",
"src/process_with_id_test.cc",
"src/storage_tool_test.cc",
"src/subprocess_tool_test.cc",
]
libs = [ "m" ]
deps = [
":debugd_dbus_utils",
":libdebugd",
"//common-mk/testrunner",
]
}
}