| # Copyright 2021 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. | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":cpp-log-decoder-tests" ] | |
| } | |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## | |
| # | |
| # ________ _________ ________ ________ | |
| # |\ ____\|\___ ___\\ __ \|\ __ \ | |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ | |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ | |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| | |
| # ____\_\ \ \ \__\ \ \_______\ \__\ | |
| # |\_________\ \|__| \|_______|\|__| | |
| # \|_________| | |
| # | |
| # | |
| # AUTO-GENERATED - DO NOT EDIT | |
| # | |
| # The targets below are auto-generated based on the targets defined in the | |
| # BUILD.bazel file from the same directory. If you made changes to targets in | |
| # Bazel, instead of editing this file manually, run: | |
| # | |
| # > fx bazel2gn | |
| # | |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and | |
| # rerun bazel2gn. | |
| import("//build/tools/bazel2gn/bazel_migration.gni") | |
| rustc_library("lib") { | |
| sources = [ "src/lib.rs" ] | |
| crate_name = "log_decoder_c_bindings" | |
| edition = "2024" | |
| visibility = [ | |
| ":*", | |
| "//src/lib/diagnostics/fake-log-sink/rust:*", | |
| ] | |
| deps = [ | |
| "//src/lib/diagnostics/log/encoding/rust", | |
| "//src/lib/diagnostics/log/message/rust", | |
| "//third_party/rust_crates:bumpalo", | |
| "//third_party/rust_crates:thiserror", | |
| ] | |
| } | |
| source_set("headers") { | |
| testonly = true | |
| public = [ "log_decoder.h" ] | |
| deps = [ "//src/lib/diagnostics/fake-log-sink/rust:rust_ffi" ] | |
| visibility = [ | |
| ":*", | |
| "//src/lib/diagnostics/fake-log-sink/cpp:*", | |
| "//src/storage/lib/watchdog:*", | |
| ] | |
| } | |
| rustc_staticlib("staticlib") { | |
| sources = [ "src/lib.rs" ] | |
| configs += [ | |
| "//build/config:optimize_size", | |
| "//build/config/lto:thinlto-if-compatible", | |
| ] | |
| crate_name = "log_decoder_c_bindings" | |
| edition = "2024" | |
| deps = [ | |
| "//src/lib/diagnostics/log/encoding/rust", | |
| "//src/lib/diagnostics/log/message/rust", | |
| "//third_party/rust_crates:bumpalo", | |
| "//third_party/rust_crates:thiserror", | |
| ] | |
| public = [ "log_decoder.h" ] | |
| } | |
| if (is_fuchsia) { | |
| source_set("log_decoder_api_cpp") { | |
| sources = [ "log_decoder_api.cc" ] | |
| public = [ | |
| "log_decoder.h", | |
| "log_decoder_api.h", | |
| ] | |
| public_deps = [ | |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", | |
| "//sdk/lib/fit-promise", | |
| ] | |
| } | |
| } | |
| if (is_fuchsia) { | |
| source_set("log_decoder_api") { | |
| visibility = [ | |
| ":*", | |
| "//src/lib/diagnostics/fidl_log_message_parser:*", | |
| ] | |
| public_deps = [ | |
| ":log_decoder_api_cpp", | |
| ":staticlib", | |
| ] | |
| } | |
| } | |
| cc_test_executable("cpp-log-decoder-unittest") { | |
| sources = [ "test.cc" ] | |
| deps = [ | |
| ":log_decoder_api_cpp", | |
| ":staticlib", | |
| "//sdk/lib/syslog/cpp", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//third_party/googletest:gtest", | |
| ] | |
| testonly = true | |
| emit_tool_path = false | |
| deps += [ "//third_party/googletest:gmock" ] | |
| } | |
| fuchsia_unittest_package("cpp-log-decoder-tests") { | |
| package_name = "cpp-log-decoder-tests-gn" | |
| component_name = "cpp-log-decoder-tests" | |
| deps = [ ":cpp-log-decoder-unittest" ] | |
| test_specs = { | |
| log_settings = { | |
| max_severity = "ERROR" | |
| } | |
| } | |
| } |