1# Copyright 2021 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_cc_test", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24cc_library( 25 name = "config", 26 hdrs = ["public/pw_function/config.h"], 27 includes = ["public"], 28 deps = [":config_override"], 29) 30 31label_flag( 32 name = "config_override", 33 build_setting_default = "//pw_build:default_module_config", 34) 35 36cc_library( 37 name = "pw_function", 38 hdrs = ["public/pw_function/function.h"], 39 includes = ["public"], 40 deps = [ 41 ":config", 42 "//pw_assert", 43 "//pw_preprocessor", 44 "//third_party/fuchsia:fit", 45 ], 46) 47 48pw_cc_test( 49 name = "function_test", 50 srcs = ["function_test.cc"], 51 deps = [ 52 ":pw_function", 53 "//pw_compilation_testing:negative_compilation_testing", 54 ], 55) 56 57cc_library( 58 name = "pointer", 59 srcs = ["public/pw_function/internal/static_invoker.h"], 60 hdrs = ["public/pw_function/pointer.h"], 61 includes = ["public"], 62) 63 64pw_cc_test( 65 name = "pointer_test", 66 srcs = ["pointer_test.cc"], 67 deps = [ 68 ":pointer", 69 ":pw_function", 70 ], 71) 72 73cc_library( 74 name = "scope_guard", 75 hdrs = ["public/pw_function/scope_guard.h"], 76 includes = ["public"], 77) 78 79pw_cc_test( 80 name = "scope_guard_test", 81 srcs = ["scope_guard_test.cc"], 82 deps = [ 83 ":pw_function", 84 ":scope_guard", 85 ], 86) 87