| # 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") |
| |
| group("all") { |
| deps = [ ":syslog-cat" ] |
| if (use.test) { |
| deps += [ ":syslogcat_testrunner" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| ] |
| } |
| |
| static_library("syslogcat_lib") { |
| sources = [ |
| "syslogcat.cc", |
| "syslogcat.h", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("syslog-cat") { |
| sources = [ "main.cc" ] |
| install_path = "sbin" |
| configs += [ ":target_defaults" ] |
| deps = [ ":syslogcat_lib" ] |
| } |
| |
| if (use.test) { |
| pkg_config("syslogcat_testrunner_config") { |
| pkg_deps = [ "libchrome-test" ] |
| } |
| |
| executable("syslogcat_testrunner") { |
| sources = [ "syslogcat_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":syslogcat_testrunner_config", |
| ":target_defaults", |
| ] |
| run_test = true |
| defines = [ "UNIT_TEST" ] |
| deps = [ |
| ":syslogcat_lib", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |