blob: ee32845ea59153b3fae3c9071cd8c79eaa615335 [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 = [
36 "//pw_preprocessor",
Keir Mierleaf5e3582019-12-30 13:11:05 -080037 ],
38)
39
Wyatt Hepler49810582020-01-24 11:26:35 -080040pw_cc_library(
41 name = "pw_log",
42 deps = [
43 ":facade",
44 PW_LOG_BACKEND,
45 ],
46)
47
48pw_cc_test(
Keir Mierleaf5e3582019-12-30 13:11:05 -080049 name = "test",
50 srcs = [
51 "basic_log_test.cc",
52 "basic_log_test_plain_c.c",
53 ],
Wyatt Hepler49810582020-01-24 11:26:35 -080054 deps = [":pw_log"],
Keir Mierleaf5e3582019-12-30 13:11:05 -080055)