| # 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 = [ ":croslog" ] |
| if (use.test) { |
| deps += [ ":croslog_testrunner" ] |
| } |
| } |
| |
| static_library("libcroslog_static") { |
| sources = [ |
| "boot_records.cc", |
| "boot_records.h", |
| "config.cc", |
| "config.h", |
| "cursor_util.cc", |
| "cursor_util.h", |
| "file_change_watcher.cc", |
| "file_change_watcher.h", |
| "file_map_reader.cc", |
| "file_map_reader.h", |
| "log_entry.cc", |
| "log_entry.h", |
| "log_entry_reader.cc", |
| "log_entry_reader.h", |
| "log_line_reader.cc", |
| "log_line_reader.h", |
| "log_parser.cc", |
| "log_parser.h", |
| "log_parser_audit.cc", |
| "log_parser_audit.h", |
| "log_parser_syslog.cc", |
| "log_parser_syslog.h", |
| "multiplexer.cc", |
| "multiplexer.h", |
| "severity.cc", |
| "severity.h", |
| "viewer_journal.cc", |
| "viewer_journal.h", |
| "viewer_plaintext.cc", |
| "viewer_plaintext.h", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "re2", |
| ] |
| } |
| |
| executable("croslog") { |
| configs += [ ":target_defaults" ] |
| |
| sources = [ "main.cc" ] |
| install_path = "sbin" |
| deps = [ ":libcroslog_static" ] |
| } |
| |
| if (use.test) { |
| pkg_config("croslog_testrunner_config") { |
| pkg_deps = [ "libchrome-test" ] |
| } |
| |
| executable("croslog_testrunner") { |
| sources = [ |
| "boot_records_test.cc", |
| "config_test.cc", |
| "cursor_util_test.cc", |
| "file_change_watcher_test.cc", |
| "log_entry_reader_test.cc", |
| "log_line_reader_test.cc", |
| "log_parser_audit_test.cc", |
| "log_parser_syslog_test.cc", |
| "multiplexer_test.cc", |
| "testrunner.cc", |
| "viewer_plaintext_test.cc", |
| ] |
| run_test = true |
| defines = [ "UNIT_TEST" ] |
| configs += [ |
| "//common-mk:test", |
| ":croslog_testrunner_config", |
| ":target_defaults", |
| ] |
| deps = [ ":libcroslog_static" ] |
| } |
| } |