• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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_string/internal/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_string",
38    deps = [
39        ":builder",
40        ":format",
41        ":to_string",
42        ":util",
43    ],
44)
45
46cc_library(
47    name = "builder",
48    srcs = ["string_builder.cc"],
49    hdrs = ["public/pw_string/string_builder.h"],
50    includes = ["public"],
51    deps = [
52        ":format",
53        ":string",
54        ":to_string",
55        ":util",
56        "//pw_preprocessor",
57        "//pw_status",
58    ],
59)
60
61cc_library(
62    name = "format",
63    srcs = ["format.cc"],
64    hdrs = ["public/pw_string/format.h"],
65    includes = ["public"],
66    deps = [
67        ":string",
68        "//pw_preprocessor",
69        "//pw_span",
70        "//pw_status",
71    ],
72)
73
74cc_library(
75    name = "string",
76    srcs = [
77        "public/pw_string/internal/string_common_functions.inc",
78        "public/pw_string/internal/string_impl.h",
79    ],
80    hdrs = ["public/pw_string/string.h"],
81    includes = ["public"],
82    deps = ["//pw_assert"],
83)
84
85cc_library(
86    name = "to_string",
87    srcs = ["type_to_string.cc"],
88    hdrs = [
89        "public/pw_string/to_string.h",
90        "public/pw_string/type_to_string.h",
91    ],
92    includes = ["public"],
93    deps = [
94        ":config",
95        ":format",
96        ":util",
97        "//pw_result",
98        "//pw_status",
99        "//third_party/fuchsia:stdcompat",
100    ],
101)
102
103cc_library(
104    name = "util",
105    srcs = ["public/pw_string/internal/length.h"],
106    hdrs = ["public/pw_string/util.h"],
107    includes = ["public"],
108    deps = [
109        ":string",
110        "//pw_assert",
111        "//pw_result",
112        "//pw_span",
113        "//pw_status",
114    ],
115)
116
117pw_cc_test(
118    name = "format_test",
119    srcs = ["format_test.cc"],
120    deps = [
121        ":format",
122        "//pw_span",
123        "//pw_unit_test",
124    ],
125)
126
127pw_cc_test(
128    name = "string_test",
129    srcs = ["string_test.cc"],
130    deps = [
131        ":string",
132        "//pw_compilation_testing:negative_compilation_testing",
133        "//pw_unit_test",
134    ],
135)
136
137pw_cc_test(
138    name = "type_to_string_test",
139    srcs = ["type_to_string_test.cc"],
140    deps = [
141        ":to_string",
142        "//pw_unit_test",
143    ],
144)
145
146pw_cc_test(
147    name = "string_builder_test",
148    srcs = ["string_builder_test.cc"],
149    deps = [
150        ":builder",
151        "//pw_unit_test",
152    ],
153)
154
155pw_cc_test(
156    name = "to_string_test",
157    srcs = ["to_string_test.cc"],
158    deps = [
159        ":config",
160        ":to_string",
161        "//pw_status",
162        "//pw_unit_test",
163    ],
164)
165
166pw_cc_test(
167    name = "util_test",
168    srcs = ["util_test.cc"],
169    deps = [
170        ":util",
171        "//pw_unit_test",
172    ],
173)
174