blob: 4dca3ecb2c2f529cde0894a7aec704273e4fa5fe [file] [log] [blame]
Keir Mierle3cee8792020-01-22 17:08:13 -08001# 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 Mierle2f813c62020-02-13 16:24:41 -080015load(
16 "//pw_build:pigweed.bzl",
17 "pw_cc_library",
18 "pw_cc_test",
19)
20
Keir Mierle3cee8792020-01-22 17:08:13 -080021package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"]) # Apache License 2.0
24
Keir Mierle2f813c62020-02-13 16:24:41 -080025# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
26PW_ASSERT_BACKEND = "//pw_assert_basic"
27
28pw_cc_library(
29 name = "facade",
30 hdrs = [
Keir Mierle3cee8792020-01-22 17:08:13 -080031 "public/pw_assert/assert.h",
32 ],
Keir Mierle2f813c62020-02-13 16:24:41 -080033 includes = ["public"],
34 deps = [
35 "//pw_preprocessor",
36 ],
Keir Mierle3cee8792020-01-22 17:08:13 -080037)
38
Keir Mierle2f813c62020-02-13 16:24:41 -080039pw_cc_library(
40 name = "pw_assert",
41 deps = [
42 ":facade",
43 PW_ASSERT_BACKEND,
44 ],
45)
46
47pw_cc_test(
Keir Mierle3cee8792020-01-22 17:08:13 -080048 name = "test",
49 srcs = [
50 "assert_test.cc",
51 "assert_test.c",
52 ],
Keir Mierle2f813c62020-02-13 16:24:41 -080053 deps = [":pw_assert"],
Keir Mierle3cee8792020-01-22 17:08:13 -080054)