| # Copyright 2020 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/pkg_config.gni") |
| |
| # Library that provides system-level utilities used by cros_healthd. |
| pkg_config("libcros_healthd_system_pkg_deps") { |
| pkg_deps = [ |
| "dbus-1", |
| "libbrillo", |
| "libchrome", |
| "libcros_config", |
| "libdebugd-client", |
| "libmojo", |
| "system_api", |
| ] |
| } |
| |
| source_set("libcros_healthd_system") { |
| configs += [ ":libcros_healthd_system_pkg_deps" ] |
| deps = [ |
| "//diagnostics/common:libcommon", |
| "//diagnostics/cros_healthd/executor:libcros_healthd_executor", |
| "//diagnostics/cros_healthd/network:libnetwork_health_adapter", |
| "//diagnostics/cros_healthd/network_diagnostics:libnetwork_diagnostics_adapter", |
| ] |
| sources = [ |
| "context.cc", |
| "system_config.cc", |
| "system_config_constants.cc", |
| "system_utilities_constants.cc", |
| "system_utilities_impl.cc", |
| ] |
| } |
| |
| if (use.test || use.fuzzer) { |
| # Libraries for unit tests and fuzzers. |
| pkg_config("libcros_healthd_system_test_utils_pkg_deps") { |
| pkg_deps = [ |
| "dbus-1", |
| "libchrome", |
| "libchrome-test", |
| "libcros_config", |
| "libdebugd-client", |
| "libdebugd-client-test", |
| "system_api", |
| ] |
| } |
| |
| source_set("libcros_healthd_system_test_utils") { |
| configs += [ |
| ":libcros_healthd_system_test_utils_pkg_deps", |
| "//common-mk:test", |
| ] |
| deps = [ |
| ":libcros_healthd_system", |
| "//diagnostics/common:libcommon_test_utils", |
| "//diagnostics/cros_healthd/executor:libcros_healthd_executor_test_utils", |
| "//diagnostics/cros_healthd/network:libnetwork_health_adapter_test_utils", |
| "//diagnostics/cros_healthd/network_diagnostics:libnetwork_diagnostics_adapter_test_utils", |
| ] |
| sources = [ |
| "fake_system_config.cc", |
| "fake_system_utilities.cc", |
| "mock_context.cc", |
| ] |
| } |
| } |
| |
| if (use.test) { |
| pkg_config("system_config_test_pkg_deps") { |
| pkg_deps = [ |
| "libchrome", |
| "libchrome-test", |
| "libcros_config", |
| ] |
| } |
| |
| executable("system_config_test") { |
| configs += [ |
| ":system_config_test_pkg_deps", |
| "//common-mk:test", |
| ] |
| deps = [ |
| ":libcros_healthd_system", |
| "//common-mk/testrunner:testrunner", |
| "//diagnostics/common:libcommon_test_utils", |
| ] |
| sources = [ "system_config_test.cc" ] |
| } |
| } |