Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 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 | |
Wyatt Hepler | 4981058 | 2020-01-24 11:26:35 -0800 | [diff] [blame] | 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | "pw_cc_test", |
| 19 | ) |
| 20 | |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 21 | package(default_visibility = ["//visibility:public"]) |
| 22 | |
| 23 | licenses(["notice"]) # Apache License 2.0 |
| 24 | |
Wyatt Hepler | 4981058 | 2020-01-24 11:26:35 -0800 | [diff] [blame] | 25 | # TODO(pwbug/101): Need to add support for facades/backends to Bazel. |
| 26 | PW_LOG_BACKEND = "//pw_log_basic" |
| 27 | |
| 28 | pw_cc_library( |
| 29 | name = "facade", |
| 30 | hdrs = [ |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 31 | "public/pw_log/levels.h", |
Wyatt Hepler | 4981058 | 2020-01-24 11:26:35 -0800 | [diff] [blame] | 32 | "public/pw_log/log.h", |
| 33 | ], |
| 34 | includes = ["public"], |
| 35 | deps = [ |
| 36 | "//pw_preprocessor", |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 37 | ], |
| 38 | ) |
| 39 | |
Wyatt Hepler | 4981058 | 2020-01-24 11:26:35 -0800 | [diff] [blame] | 40 | pw_cc_library( |
| 41 | name = "pw_log", |
| 42 | deps = [ |
| 43 | ":facade", |
| 44 | PW_LOG_BACKEND, |
| 45 | ], |
| 46 | ) |
| 47 | |
| 48 | pw_cc_test( |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 49 | name = "test", |
| 50 | srcs = [ |
| 51 | "basic_log_test.cc", |
| 52 | "basic_log_test_plain_c.c", |
| 53 | ], |
Wyatt Hepler | 4981058 | 2020-01-24 11:26:35 -0800 | [diff] [blame] | 54 | deps = [":pw_log"], |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 55 | ) |