blob: 080fc99d8c61d624d9dbef0990f3f3bb18702754 [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 = [
Armando Montanez3d3e5382022-01-11 15:15:15 -080029 "assert_lite_public_overrides/pw_assert_backend/assert_lite_backend.h",
Wyatt Heplerdf1dfba2022-02-01 11:54:57 -080030 "print_and_abort_public_overrides/pw_assert_backend/assert_lite_backend.h",
Keir Mierle3cee8792020-01-22 17:08:13 -080031 "public/pw_assert/assert.h",
Wyatt Heplera59998f2021-03-19 14:35:10 -070032 "public/pw_assert/check.h",
Ewout van Bekkum2aff88e2021-11-12 15:36:57 -080033 "public/pw_assert/config.h",
Wyatt Heplera59998f2021-03-19 14:35:10 -070034 "public/pw_assert/internal/check_impl.h",
Wyatt Heplerdf1dfba2022-02-01 11:54:57 -080035 "public/pw_assert/internal/print_and_abort.h",
Wyatt Heplera59998f2021-03-19 14:35:10 -070036 "public/pw_assert/short.h",
Keir Mierle3cee8792020-01-22 17:08:13 -080037 ],
Armando Montanez3d3e5382022-01-11 15:15:15 -080038 includes = [
39 "assert_lite_public_overrides",
40 "public",
41 ],
Keir Mierle2f813c62020-02-13 16:24:41 -080042 deps = [
43 "//pw_preprocessor",
44 ],
Keir Mierle3cee8792020-01-22 17:08:13 -080045)
46
Keir Mierle2f813c62020-02-13 16:24:41 -080047pw_cc_library(
48 name = "pw_assert",
49 deps = [
50 ":facade",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080051 "@pigweed_config//:pw_assert_backend",
Rob Mohr06819482020-04-06 13:25:43 -070052 ],
53)
54
55pw_cc_library(
Nathaniel Broughc2d57812021-04-18 22:52:00 +080056 name = "backend_multiplexer",
57 visibility = ["@pigweed_config//:__pkg__"],
58 deps = ["@pigweed//pw_assert_basic"],
Keir Mierle2f813c62020-02-13 16:24:41 -080059)
60
61pw_cc_test(
Keir Mierle8d2a84f2020-04-14 22:00:00 -070062 name = "assert_facade_test",
Keir Mierle3cee8792020-01-22 17:08:13 -080063 srcs = [
Keir Mierle8d2a84f2020-04-14 22:00:00 -070064 "assert_facade_test.cc",
Wyatt Hepler3d0e3152021-04-29 17:08:31 -070065 "assert_test.cc",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070066 "fake_backend.cc",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080067 "public/pw_assert/internal/check_impl.h",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070068 "pw_assert_test/fake_backend.h",
69 ],
70 deps = [
Rob Mohrfcc1ae52020-04-16 11:03:19 -070071 ":facade",
Nathaniel Broughf91e7632021-07-26 17:12:14 +080072 "//pw_assert",
Rob Mohra02f0bf2020-04-21 07:06:51 -070073 "//pw_preprocessor",
Rob Mohr0b8d5b12020-04-20 10:14:50 -070074 "//pw_span",
75 "//pw_string",
Keir Mierle8d2a84f2020-04-14 22:00:00 -070076 "//pw_unit_test",
77 ],
78)
79
80pw_cc_test(
81 name = "assert_backend_compile_test",
82 srcs = [
Keir Mierle8d2a84f2020-04-14 22:00:00 -070083 "assert_backend_compile_test.cc",
Nathaniel Brough975a3c22021-02-28 21:46:16 +080084 "assert_backend_compile_test_c.c",
Keir Mierle3cee8792020-01-22 17:08:13 -080085 ],
Rob Mohr06819482020-04-06 13:25:43 -070086 deps = [
Nathaniel Broughf91e7632021-07-26 17:12:14 +080087 "//pw_assert",
Rob Mohr06819482020-04-06 13:25:43 -070088 "//pw_unit_test",
89 ],
Keir Mierle3cee8792020-01-22 17:08:13 -080090)