blob: 8b181316b0c44b163d197e76f6a82e49030e284b [file] [log] [blame]
Nathaniel Brough975a3c22021-02-28 21:46:16 +08001# Copyright 2021 The Pigweed Authors
Keir Mierle3cee8792020-01-22 17:08:13 -08002#
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 Mierle2f813c62020-02-13 16:24:41 -080015load(
16 "//pw_build:pigweed.bzl",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080017 "pw_cc_facade",
Keir Mierle2f813c62020-02-13 16:24:41 -080018 "pw_cc_library",
19 "pw_cc_test",
20)
21
Keir Mierle3cee8792020-01-22 17:08:13 -080022package(default_visibility = ["//visibility:public"])
23
Rob Mohr5fc25412021-06-23 09:35:23 -070024licenses(["notice"])
Keir Mierle3cee8792020-01-22 17:08:13 -080025
Nathaniel Broughc2d57812021-04-18 22:52:00 +080026pw_cc_facade(
Keir Mierle2f813c62020-02-13 16:24:41 -080027 name = "facade",
28 hdrs = [
Keir Mierle3cee8792020-01-22 17:08:13 -080029 "public/pw_assert/assert.h",
Wyatt Heplera59998f2021-03-19 14:35:10 -070030 "public/pw_assert/check.h",
31 "public/pw_assert/internal/check_impl.h",
Keir Mierle854adec2020-09-03 14:07:19 -070032 "public/pw_assert/options.h",
Wyatt Heplera59998f2021-03-19 14:35:10 -070033 "public/pw_assert/short.h",
Keir Mierle3cee8792020-01-22 17:08:13 -080034 ],
Keir Mierle2f813c62020-02-13 16:24:41 -080035 includes = ["public"],
36 deps = [
37 "//pw_preprocessor",
38 ],
Keir Mierle3cee8792020-01-22 17:08:13 -080039)
40
Keir Mierle2f813c62020-02-13 16:24:41 -080041pw_cc_library(
42 name = "pw_assert",
43 deps = [
44 ":facade",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080045 "@pigweed_config//:pw_assert_backend",
Rob Mohr06819482020-04-06 13:25:43 -070046 ],
47)
48
49pw_cc_library(
Nathaniel Broughc2d57812021-04-18 22:52:00 +080050 name = "backend_multiplexer",
51 visibility = ["@pigweed_config//:__pkg__"],
52 deps = ["@pigweed//pw_assert_basic"],
Keir Mierle2f813c62020-02-13 16:24:41 -080053)
54
55pw_cc_test(
Keir Mierle8d2a84f2020-04-14 22:00:00 -070056 name = "assert_facade_test",
Keir Mierle3cee8792020-01-22 17:08:13 -080057 srcs = [
Keir Mierle8d2a84f2020-04-14 22:00:00 -070058 "assert_facade_test.cc",
Wyatt Hepler3d0e3152021-04-29 17:08:31 -070059 "assert_test.cc",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070060 "fake_backend.cc",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080061 "public/pw_assert/internal/check_impl.h",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070062 "pw_assert_test/fake_backend.h",
63 ],
64 deps = [
Rob Mohrfcc1ae52020-04-16 11:03:19 -070065 ":facade",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080066 ":pw_assert",
Rob Mohra02f0bf2020-04-21 07:06:51 -070067 "//pw_preprocessor",
Rob Mohr0b8d5b12020-04-20 10:14:50 -070068 "//pw_span",
69 "//pw_string",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070070 "//pw_unit_test",
71 ],
72)
73
74pw_cc_test(
75 name = "assert_backend_compile_test",
76 srcs = [
Keir Mierle8d2a84f2020-04-14 22:00:00 -070077 "assert_backend_compile_test.cc",
Nathaniel Brough975a3c22021-02-28 21:46:16 +080078 "assert_backend_compile_test_c.c",
Keir Mierle3cee8792020-01-22 17:08:13 -080079 ],
Rob Mohr06819482020-04-06 13:25:43 -070080 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070081 ":pw_assert",
82 "//pw_unit_test",
83 ],
Keir Mierle3cee8792020-01-22 17:08:13 -080084)