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 15load( 16 "//pw_build:pigweed.bzl", 17 "pw_facade", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24# Note: to avoid circular dependencies, this target only includes the headers 25# for pw_assert_basic. The source file and its dependencies are in the separate 26# ":impl" target. 27# 28# If you point @pigweed//pw_assert:backend to //pw_assert_basic, then 29# @pigweed//pw_assert:backend_impl should point to //pw_assert_basic:impl. 30cc_library( 31 name = "pw_assert_basic", 32 hdrs = [ 33 "public/pw_assert_basic/assert_basic.h", 34 "public_overrides/pw_assert_backend/check_backend.h", 35 ], 36 includes = [ 37 "public", 38 "public_overrides", 39 ], 40 deps = [ 41 ":handler_facade", 42 "//pw_assert:assert_compatibility_backend", 43 "//pw_preprocessor", 44 ], 45) 46 47pw_facade( 48 name = "handler", 49 hdrs = [ 50 "public/pw_assert_basic/handler.h", 51 ], 52 backend = ":handler_backend", 53 includes = [ 54 "public", 55 ], 56 deps = [ 57 "//pw_preprocessor", 58 ], 59) 60 61label_flag( 62 name = "handler_backend", 63 build_setting_default = ":pw_assert_basic_handler", 64) 65 66cc_library( 67 name = "impl", 68 srcs = [ 69 "assert_basic.cc", 70 ], 71 deps = [ 72 ":handler", 73 ":pw_assert_basic", 74 "//pw_assert:pw_assert.facade", 75 "//pw_preprocessor", 76 ], 77 # Other libraries may not always depend on this library, even if it is 78 # necessary at link time. 79 alwayslink = 1, 80) 81 82cc_library( 83 name = "pw_assert_basic_handler", 84 srcs = [ 85 "basic_handler.cc", 86 ], 87 implementation_deps = [ 88 "//pw_preprocessor", 89 "//pw_string:builder", 90 "//pw_sys_io", 91 ], 92 deps = [":handler.facade"], 93 # Other libraries may not always depend on this library, even if it is 94 # necessary at link time. 95 alwayslink = 1, 96) 97