Nathaniel Brough | 975a3c2 | 2021-02-28 21:46:16 +0800 | [diff] [blame] | 1 | # Copyright 2021 The Pigweed Authors |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 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", |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 17 | "pw_cc_facade", |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 18 | "pw_cc_library", |
| 19 | "pw_cc_test", |
| 20 | ) |
| 21 | |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 22 | package(default_visibility = ["//visibility:public"]) |
| 23 | |
Rob Mohr | 5fc2541 | 2021-06-23 09:35:23 -0700 | [diff] [blame] | 24 | licenses(["notice"]) |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 25 | |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 26 | pw_cc_facade( |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 27 | name = "facade", |
| 28 | hdrs = [ |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 29 | "public/pw_assert/assert.h", |
Wyatt Hepler | a59998f | 2021-03-19 14:35:10 -0700 | [diff] [blame] | 30 | "public/pw_assert/check.h", |
| 31 | "public/pw_assert/internal/check_impl.h", |
Keir Mierle | 854adec | 2020-09-03 14:07:19 -0700 | [diff] [blame] | 32 | "public/pw_assert/options.h", |
Wyatt Hepler | a59998f | 2021-03-19 14:35:10 -0700 | [diff] [blame] | 33 | "public/pw_assert/short.h", |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 34 | ], |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 35 | includes = ["public"], |
| 36 | deps = [ |
| 37 | "//pw_preprocessor", |
| 38 | ], |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 39 | ) |
| 40 | |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 41 | pw_cc_library( |
| 42 | name = "pw_assert", |
| 43 | deps = [ |
| 44 | ":facade", |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 45 | "@pigweed_config//:pw_assert_backend", |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 46 | ], |
| 47 | ) |
| 48 | |
| 49 | pw_cc_library( |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 50 | name = "backend_multiplexer", |
| 51 | visibility = ["@pigweed_config//:__pkg__"], |
| 52 | deps = ["@pigweed//pw_assert_basic"], |
Keir Mierle | 2f813c6 | 2020-02-13 16:24:41 -0800 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | pw_cc_test( |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 56 | name = "assert_facade_test", |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 57 | srcs = [ |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 58 | "assert_facade_test.cc", |
Wyatt Hepler | 3d0e315 | 2021-04-29 17:08:31 -0700 | [diff] [blame] | 59 | "assert_test.cc", |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 60 | "fake_backend.cc", |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 61 | "public/pw_assert/internal/check_impl.h", |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 62 | "pw_assert_test/fake_backend.h", |
| 63 | ], |
| 64 | deps = [ |
Rob Mohr | fcc1ae5 | 2020-04-16 11:03:19 -0700 | [diff] [blame] | 65 | ":facade", |
Nathaniel Brough | f91e763 | 2021-07-26 17:12:14 +0800 | [diff] [blame] | 66 | "//pw_assert", |
Rob Mohr | a02f0bf | 2020-04-21 07:06:51 -0700 | [diff] [blame] | 67 | "//pw_preprocessor", |
Rob Mohr | 0b8d5b1 | 2020-04-20 10:14:50 -0700 | [diff] [blame] | 68 | "//pw_span", |
| 69 | "//pw_string", |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 70 | "//pw_unit_test", |
| 71 | ], |
| 72 | ) |
| 73 | |
| 74 | pw_cc_test( |
| 75 | name = "assert_backend_compile_test", |
| 76 | srcs = [ |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 77 | "assert_backend_compile_test.cc", |
Nathaniel Brough | 975a3c2 | 2021-02-28 21:46:16 +0800 | [diff] [blame] | 78 | "assert_backend_compile_test_c.c", |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 79 | ], |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 80 | deps = [ |
Nathaniel Brough | f91e763 | 2021-07-26 17:12:14 +0800 | [diff] [blame] | 81 | "//pw_assert", |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 82 | "//pw_unit_test", |
| 83 | ], |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 84 | ) |