Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -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 | |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | "pw_cc_test", |
| 19 | ) |
| 20 | |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 21 | package(default_visibility = ["//visibility:public"]) |
| 22 | |
| 23 | licenses(["notice"]) # Apache License 2.0 |
| 24 | |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 25 | # TODO(pwbug/101): Need to add support for facades/backends to Bazel. |
| 26 | PW_ASSERT_BACKEND = "//pw_assert_basic" |
| 27 | |
| 28 | pw_cc_library( |
| 29 | name = "facade", |
| 30 | hdrs = [ |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 31 | "public/pw_assert/assert.h", |
| 32 | ], |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 33 | includes = ["public"], |
| 34 | deps = [ |
| 35 | "//pw_preprocessor", |
| 36 | ], |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 37 | ) |
| 38 | |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 39 | pw_cc_library( |
| 40 | name = "pw_assert", |
| 41 | deps = [ |
| 42 | ":facade", |
| 43 | PW_ASSERT_BACKEND, |
| 44 | ], |
| 45 | ) |
| 46 | |
| 47 | pw_cc_test( |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 48 | name = "test", |
| 49 | srcs = [ |
| 50 | "assert_test.cc", |
| 51 | "assert_test.c", |
| 52 | ], |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 53 | deps = [":pw_assert"], |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 54 | ) |