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("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 16 17package(default_visibility = ["//visibility:public"]) 18 19licenses(["notice"]) 20 21cc_library( 22 name = "pw_status", 23 srcs = [ 24 "status.cc", 25 ], 26 hdrs = [ 27 "public/pw_status/internal/config.h", 28 "public/pw_status/status.h", 29 "public/pw_status/status_with_size.h", 30 "public/pw_status/try.h", 31 ], 32 strip_include_prefix = "public", 33 deps = [":config_override"], 34) 35 36label_flag( 37 name = "config_override", 38 build_setting_default = ":default_config", 39) 40 41cc_library( 42 name = "default_config", 43 defines = ["PW_STATUS_CFG_CHECK_IF_USED=1"], 44) 45 46pw_cc_test( 47 name = "status_test", 48 srcs = [ 49 "status_test.cc", 50 "status_test_c.c", 51 ], 52 deps = [ 53 ":pw_status", 54 "//pw_unit_test", 55 ], 56) 57 58pw_cc_test( 59 name = "status_with_size_test", 60 srcs = ["status_with_size_test.cc"], 61 deps = [ 62 ":pw_status", 63 "//pw_unit_test", 64 ], 65) 66 67pw_cc_test( 68 name = "try_test", 69 srcs = ["try_test.cc"], 70 deps = [ 71 ":pw_status", 72 "//pw_unit_test", 73 ], 74) 75 76filegroup( 77 name = "doxygen", 78 srcs = [ 79 "public/pw_status/status.h", 80 "public/pw_status/status_with_size.h", 81 "public/pw_status/try.h", 82 ], 83) 84