xref: /aosp_15_r20/external/pigweed/pw_log_string/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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("//pw_build:pw_facade.bzl", "pw_facade")
16
17package(default_visibility = ["//visibility:public"])
18
19licenses(["notice"])
20
21cc_library(
22    name = "pw_log_string",
23    hdrs = [
24        "public_overrides/pw_log_backend/log_backend.h",
25    ],
26    includes = [
27        "public_overrides",
28    ],
29    deps = [
30        ":handler.facade",
31        "//pw_preprocessor",
32    ],
33)
34
35pw_facade(
36    name = "handler",
37    srcs = ["handler.cc"],
38    hdrs = [
39        "public/pw_log_string/config.h",
40        "public/pw_log_string/handler.h",
41    ],
42    backend = ":handler_backend",
43    strip_include_prefix = "public",
44    deps = [
45        "//pw_preprocessor",
46    ],
47)
48
49label_flag(
50    name = "handler_backend",
51    build_setting_default = "//pw_build:unspecified_backend",
52)
53
54label_flag(
55    name = "config_override",
56    build_setting_default = "//pw_build:default_module_config",
57)
58
59alias(
60    name = "impl",
61    actual = ":handler",
62)
63
64cc_library(
65    name = "wrap_newlib_assert",
66    srcs = [
67        "wrap_newlib_assert.cc",
68    ],
69    linkopts = [
70        "-Wl,--wrap=__assert_func",
71    ],
72    deps = [
73        ":handler",
74        "//pw_log",
75    ],
76    alwayslink = 1,
77)
78
79filegroup(
80    name = "doxygen",
81    srcs = [
82        "public/pw_log_string/handler.h",
83    ],
84)
85