blob: 312c202c006da78926d4015abcc35dfc64c089c2 [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",
17 "pw_cc_library",
18 "pw_cc_test",
19)
20
Keir Mierleaf5e3582019-12-30 13:11:05 -080021package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"]) # Apache License 2.0
24
Wyatt Hepler49810582020-01-24 11:26:35 -080025# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
26PW_LOG_BACKEND = "//pw_log_basic"
27
28pw_cc_library(
29 name = "facade",
30 hdrs = [
Keir Mierleaf5e3582019-12-30 13:11:05 -080031 "public/pw_log/levels.h",
Wyatt Hepler49810582020-01-24 11:26:35 -080032 "public/pw_log/log.h",
33 ],
34 includes = ["public"],
35 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070036 PW_LOG_BACKEND + ":headers",
Wyatt Hepler49810582020-01-24 11:26:35 -080037 "//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",
Rob Mohr4d615402020-04-03 12:13:19 -070045 PW_LOG_BACKEND + ":headers",
46 ],
47)
48
49pw_cc_library(
50 name = "backend",
51 deps = [
Wyatt Hepler49810582020-01-24 11:26:35 -080052 PW_LOG_BACKEND,
53 ],
54)
55
56pw_cc_test(
Keir Mierleaf5e3582019-12-30 13:11:05 -080057 name = "test",
58 srcs = [
59 "basic_log_test.cc",
60 "basic_log_test_plain_c.c",
61 ],
Rob Mohr4d615402020-04-03 12:13:19 -070062 deps = [
63 ":backend",
Rob Mohr06819482020-04-06 13:25:43 -070064 ":facade",
Rob Mohr4d615402020-04-03 12:13:19 -070065 ":pw_log",
Rob Mohr06819482020-04-06 13:25:43 -070066 "//pw_preprocessor",
67 "//pw_unit_test",
Rob Mohr4d615402020-04-03 12:13:19 -070068 ],
Keir Mierleaf5e3582019-12-30 13:11:05 -080069)