1# Copyright 2020 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_library", 18 "pw_cc_test", 19) 20 21package(default_visibility = ["//visibility:public"]) 22 23licenses(["notice"]) 24 25pw_cc_library( 26 name = "headers", 27 hdrs = [ 28 "public/pw_log_tokenized/config.h", 29 "public/pw_log_tokenized/log_tokenized.h", 30 "public/pw_log_tokenized/metadata.h", 31 "public_overrides/pw_log_backend/log_backend.h", 32 ], 33 includes = [ 34 "public", 35 "public_overrides", 36 ], 37 deps = [ 38 "//pw_log:facade", 39 "//pw_tokenizer", 40 ], 41) 42 43pw_cc_library( 44 name = "pw_log_tokenized", 45 srcs = ["log_tokenized.cc"], 46 deps = [ 47 ":handler", 48 ":headers", 49 "//pw_log:facade", 50 ], 51) 52 53pw_cc_library( 54 name = "handler_facade", 55 hdrs = ["public/pw_log_tokenized/handler.h"], 56 includes = ["public"], 57 deps = ["//pw_preprocessor"], 58) 59 60pw_cc_library( 61 name = "handler", 62 deps = [ 63 ":handler_facade", 64 "@pigweed_config//:pw_log_tokenized_handler_backend", 65 ], 66) 67 68# There is no default backend for now. 69pw_cc_library( 70 name = "backend_multiplexer", 71 visibility = ["@pigweed_config//:__pkg__"], 72) 73 74# The compatibility library is not needed in Bazel. 75pw_cc_library( 76 name = "compatibility", 77 srcs = ["compatibility.cc"], 78 visibility = ["//visibility:private"], 79 deps = [ 80 ":handler_facade", 81 "//pw_tokenizer", 82 "//pw_tokenizer:global_handler_with_payload", 83 ], 84) 85 86pw_cc_library( 87 name = "base64_over_hdlc", 88 srcs = ["base64_over_hdlc.cc"], 89 hdrs = ["public/pw_log_tokenized/base64_over_hdlc.h"], 90 includes = ["public"], 91 deps = [ 92 ":handler_facade", 93 "//pw_hdlc", 94 "//pw_stream:sys_io_stream", 95 "//pw_tokenizer:base64", 96 ], 97) 98 99pw_cc_test( 100 name = "log_tokenized_test", 101 srcs = [ 102 "log_tokenized_test.cc", 103 "log_tokenized_test_c.c", 104 "pw_log_tokenized_private/test_utils.h", 105 ], 106 deps = [ 107 ":headers", 108 "//pw_unit_test", 109 ], 110) 111 112pw_cc_test( 113 name = "metadata_test", 114 srcs = [ 115 "metadata_test.cc", 116 ], 117 deps = [ 118 ":headers", 119 "//pw_unit_test", 120 ], 121) 122