blob: 8157c9eec57479ed3121b26cdb9cae2fe2bf3896 [file] [log] [blame]
Keir Mierleaf5e3582019-12-30 13:11:05 -08001# 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
Wyatt Hepler49810582020-01-24 11:26:35 -080015load(
16 "//pw_build:pigweed.bzl",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080017 "pw_cc_facade",
Wyatt Hepler49810582020-01-24 11:26:35 -080018 "pw_cc_library",
19 "pw_cc_test",
20)
21
Keir Mierleaf5e3582019-12-30 13:11:05 -080022package(default_visibility = ["//visibility:public"])
23
24licenses(["notice"]) # Apache License 2.0
25
Nathaniel Broughc2d57812021-04-18 22:52:00 +080026pw_cc_facade(
Wyatt Hepler49810582020-01-24 11:26:35 -080027 name = "facade",
28 hdrs = [
Keir Mierleaf5e3582019-12-30 13:11:05 -080029 "public/pw_log/levels.h",
Wyatt Hepler49810582020-01-24 11:26:35 -080030 "public/pw_log/log.h",
Wyatt Hepler9a5d64e2020-08-06 12:36:11 -070031 "public/pw_log/options.h",
Wyatt Hepler0cdb1a32021-03-05 14:16:13 -080032 "public/pw_log/short.h",
33 "public/pw_log/shorter.h",
Wyatt Hepler49810582020-01-24 11:26:35 -080034 ],
35 includes = ["public"],
36 deps = [
37 "//pw_preprocessor",
Keir Mierleaf5e3582019-12-30 13:11:05 -080038 ],
39)
40
Wyatt Hepler49810582020-01-24 11:26:35 -080041pw_cc_library(
42 name = "pw_log",
43 deps = [
44 ":facade",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080045 "@pigweed_config//:pw_log_backend",
Rob Mohr4d615402020-04-03 12:13:19 -070046 ],
47)
48
49pw_cc_library(
Prashanth Swaminathan8015cec2021-06-04 10:00:40 -070050 name = "proto_utils",
51 srcs = [
52 "proto_utils.cc",
53 ],
54 hdrs = [
55 "public/pw_log/proto_utils.h",
56 ],
57 deps = [
58 ":facade",
59 "//pw_bytes",
60 "//pw_log_tokenized",
61 "//pw_result",
62 ],
63)
64
65pw_cc_library(
Nathaniel Broughc2d57812021-04-18 22:52:00 +080066 name = "backend_multiplexer",
67 visibility = ["@pigweed_config//:__pkg__"],
68 deps = ["//pw_log_basic"],
Wyatt Hepler49810582020-01-24 11:26:35 -080069)
70
71pw_cc_test(
Keir Mierleaf5e3582019-12-30 13:11:05 -080072 name = "test",
73 srcs = [
74 "basic_log_test.cc",
75 "basic_log_test_plain_c.c",
76 ],
Rob Mohr4d615402020-04-03 12:13:19 -070077 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070078 ":facade",
Rob Mohr4d615402020-04-03 12:13:19 -070079 ":pw_log",
Rob Mohr06819482020-04-06 13:25:43 -070080 "//pw_preprocessor",
81 "//pw_unit_test",
Rob Mohr4d615402020-04-03 12:13:19 -070082 ],
Keir Mierleaf5e3582019-12-30 13:11:05 -080083)
Prashanth Swaminathan8015cec2021-06-04 10:00:40 -070084
85pw_cc_test(
86 name = "proto_utils_test",
87 srcs = [
88 "proto_utils_test.cc",
89 ],
90 deps = [
91 ":facade",
92 ":proto_utils",
Prashanth Swaminathan8015cec2021-06-04 10:00:40 -070093 "//pw_preprocessor",
Rob Mohr9c266ab2021-06-14 17:48:49 -070094 "//pw_protobuf",
Prashanth Swaminathan8015cec2021-06-04 10:00:40 -070095 "//pw_unit_test",
96 ],
97)