1# Copyright 2022 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("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18load("//pw_build:pw_facade.bzl", "pw_facade") 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24cc_library( 25 name = "pw_log_string", 26 hdrs = [ 27 "public_overrides/pw_log_backend/log_backend.h", 28 ], 29 strip_include_prefix = "public_overrides", 30 deps = [ 31 ":handler.facade", 32 "//pw_preprocessor", 33 ], 34) 35 36pw_facade( 37 name = "handler", 38 srcs = ["handler.cc"], 39 hdrs = [ 40 "public/pw_log_string/config.h", 41 "public/pw_log_string/handler.h", 42 ], 43 backend = ":handler_backend", 44 strip_include_prefix = "public", 45 deps = [ 46 "//pw_preprocessor", 47 ], 48) 49 50label_flag( 51 name = "handler_backend", 52 build_setting_default = "//pw_build:unspecified_backend", 53) 54 55label_flag( 56 name = "config_override", 57 build_setting_default = "//pw_build:default_module_config", 58) 59 60alias( 61 name = "impl", 62 actual = ":handler", 63) 64 65cc_library( 66 name = "wrap_newlib_assert", 67 srcs = [ 68 "wrap_newlib_assert.cc", 69 ], 70 linkopts = [ 71 "-Wl,--wrap=__assert_func", 72 ], 73 deps = [ 74 ":handler", 75 "//pw_log", 76 ], 77 alwayslink = 1, 78) 79 80filegroup( 81 name = "doxygen", 82 srcs = [ 83 "public/pw_log_string/handler.h", 84 ], 85) 86 87sphinx_docs_library( 88 name = "docs", 89 srcs = [ 90 "docs.rst", 91 ], 92 prefix = "pw_log_string/", 93 target_compatible_with = incompatible_with_mcu(), 94) 95