| # Copyright 2019 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 with utilities common to both cros_healthd and wilco_dtc_supportd. |
| pkg_config("libcommon_pkg_deps") { |
| pkg_deps = [ |
| "libbrillo-${libbase_ver}", |
| "libchrome-${libbase_ver}", |
| "libdebugd-client", |
| "libmojo-${libbase_ver}", |
| ] |
| } |
| |
| source_set("libcommon") { |
| public_configs = [ ":libcommon_pkg_deps" ] |
| sources = [ |
| "file_utils.cc", |
| "mojo_utils.cc", |
| "system/debugd_adapter_impl.cc", |
| ] |
| } |
| |
| if (use.test) { |
| # Library with common utilities only to be used during testing. |
| pkg_config("libcommon_test_utils_pkg_deps") { |
| pkg_deps = [ |
| "libchrome-${libbase_ver}", |
| "libdebugd-client-test", |
| "libmojo-${libbase_ver}", |
| ] |
| } |
| |
| source_set("libcommon_test_utils") { |
| deps = [ |
| ":libcommon", |
| ] |
| all_dependent_configs = [ ":libcommon_test_utils_pkg_deps" ] |
| sources = [ |
| "file_test_utils.cc", |
| "mojo_test_utils.cc", |
| "system/mock_debugd_adapter.cc", |
| ] |
| } |
| |
| pkg_config("libcommon_test_pkg_deps") { |
| pkg_deps = [ |
| "libdebugd-client-test", |
| "libchrome-${libbase_ver}", |
| "libchrome-test-${libbase_ver}", |
| "libmojo-${libbase_ver}", |
| ] |
| } |
| |
| executable("libcommon_test") { |
| configs += [ |
| ":libcommon_test_pkg_deps", |
| "//common-mk:test", |
| ] |
| deps = [ |
| ":libcommon", |
| ":libcommon_test_utils", |
| "//common-mk/testrunner:testrunner", |
| ] |
| sources = [ |
| "mojo_utils_test.cc", |
| "system/debugd_adapter_impl_test.cc", |
| ] |
| } |
| } |