| # Copyright 2020 The Fuchsia 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("//build/testing/environments.gni") |
| import("//src/sys/build/components.gni") |
| |
| source_set("lib") { |
| sources = [ "log.cc" ] |
| |
| public = [ "log.h" ] |
| |
| deps = [ |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/syslog", |
| ] |
| |
| public_deps = [ "//sdk/fidl/fuchsia.logger" ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("bin") { |
| output_name = "log" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.logger", |
| "//sdk/lib/sys/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_shell_package("log") { |
| deps = [ ":bin" ] |
| manifest = "log.cmx" |
| } |
| |
| executable("tools_log_test_bin") { |
| testonly = true |
| |
| sources = [ "test.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.logger", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//zircon/system/ulib/syslog", |
| ] |
| } |
| |
| fuchsia_unittest_package("tools_log_test") { |
| deps = [ ":tools_log_test_bin" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| public_deps = [ ":tools_log_test" ] |
| } |