| # 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. | 
 |  | 
 | import("//build/components.gni") | 
 | import("//build/config/fuchsia/target_api_level.gni") | 
 | import("//build/rust/rustc_library.gni") | 
 |  | 
 | group("rust") { | 
 |   public_deps = [ ":lib" ] | 
 | } | 
 |  | 
 | group("tests") { | 
 |   testonly = true | 
 |   deps = [ | 
 |     ":diagnostics-message-tests", | 
 |     "cpp-log-decoder:tests", | 
 |   ] | 
 | } | 
 |  | 
 | rustc_library("lib") { | 
 |   edition = "2021" | 
 |   name = "diagnostics_message" | 
 |   with_unit_tests = true | 
 |  | 
 |   deps = [ | 
 |     "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", | 
 |     "//sdk/rust/zx", | 
 |     "//src/lib/diagnostics/data/rust", | 
 |     "//src/lib/diagnostics/log/encoding/rust", | 
 |     "//src/sys/lib/moniker", | 
 |     "//third_party/rust_crates:bumpalo", | 
 |     "//third_party/rust_crates:byteorder", | 
 |     "//third_party/rust_crates:flyweights", | 
 |     "//third_party/rust_crates:libc", | 
 |     "//third_party/rust_crates:thiserror", | 
 |   ] | 
 |  | 
 |   if (current_build_target_api_level == "HEAD" || | 
 |       current_build_target_api_level == "PLATFORM") { | 
 |     deps += [ "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust" ] | 
 |   } | 
 |  | 
 |   test_deps = [ | 
 |     "//src/lib/fuchsia", | 
 |     "//third_party/rust_crates:assert_matches", | 
 |   ] | 
 |  | 
 |   sources = [ | 
 |     "src/constants.rs", | 
 |     "src/error.rs", | 
 |     "src/ffi.rs", | 
 |     "src/lib.rs", | 
 |     "src/test.rs", | 
 |   ] | 
 |  | 
 |   configs += [ "//build/config/rust/lints:clippy_warn_all" ] | 
 | } | 
 |  | 
 | fuchsia_unittest_package("diagnostics-message-tests") { | 
 |   deps = [ ":lib_test" ] | 
 | } |