blob: 663bb4f26f218d56fce499aa22cf699d298f5216 [file] [log] [blame]
Rob Mohr75e5fc92019-11-14 09:16:03 -08001# 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
Rob Mohr75e5fc92019-11-14 09:16:03 -080015load(
16 "//pw_build:pigweed.bzl",
Rob Mohrc70366e2019-11-18 11:09:39 -080017 "pw_cc_library",
18 "pw_cc_test",
Rob Mohr75e5fc92019-11-14 09:16:03 -080019)
20
Rob Mohrc2787502019-11-19 09:50:42 -080021package(default_visibility = ["//visibility:public"])
22
Rob Mohr5fc25412021-06-23 09:35:23 -070023licenses(["notice"])
Rob Mohrc2787502019-11-19 09:50:42 -080024
Rob Mohrc70366e2019-11-18 11:09:39 -080025pw_cc_library(
Rob Mohr75e5fc92019-11-14 09:16:03 -080026 name = "pw_string",
Wyatt Heplere2dc6d12019-11-15 09:05:07 -080027 srcs = [
28 "format.cc",
Wyatt Heplerce9b9522019-11-11 10:45:48 -080029 "string_builder.cc",
Wyatt Heplere2dc6d12019-11-15 09:05:07 -080030 "type_to_string.cc",
31 ],
Rob Mohrcf185b42019-11-14 10:23:28 -080032 hdrs = [
Wyatt Heplere2dc6d12019-11-15 09:05:07 -080033 "public/pw_string/format.h",
Ewout van Bekkumf89f1372021-05-03 11:15:54 -070034 "public/pw_string/internal/length.h",
Wyatt Heplerce9b9522019-11-11 10:45:48 -080035 "public/pw_string/string_builder.h",
Rob Mohrcf185b42019-11-14 10:23:28 -080036 "public/pw_string/to_string.h",
37 "public/pw_string/type_to_string.h",
Wyatt Heplerce9b9522019-11-11 10:45:48 -080038 "public/pw_string/util.h",
Rob Mohrcf185b42019-11-14 10:23:28 -080039 ],
Wyatt Hepler61def0a2020-01-06 10:30:14 -080040 includes = ["public"],
Rob Mohr75e5fc92019-11-14 09:16:03 -080041 deps = [
Nathaniel Broughf91e7632021-07-26 17:12:14 +080042 "//pw_assert:facade",
Rob Mohr10663e22021-05-14 12:48:35 -070043 "//pw_preprocessor",
Ewout van Bekkumf89f1372021-05-03 11:15:54 -070044 "//pw_result",
Rob Mohr10663e22021-05-14 12:48:35 -070045 "//pw_span",
46 "//pw_status",
Rob Mohr75e5fc92019-11-14 09:16:03 -080047 ],
48)
49
Rob Mohrc70366e2019-11-18 11:09:39 -080050pw_cc_test(
Wyatt Heplere2dc6d12019-11-15 09:05:07 -080051 name = "format_test",
52 srcs = ["format_test.cc"],
Rob Mohrc8dd7fd2019-11-19 09:15:26 -080053 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070054 ":pw_string",
Rob Mohrc8dd7fd2019-11-19 09:15:26 -080055 "//pw_span",
Rob Mohr06819482020-04-06 13:25:43 -070056 "//pw_unit_test",
Rob Mohrc8dd7fd2019-11-19 09:15:26 -080057 ],
Wyatt Heplere2dc6d12019-11-15 09:05:07 -080058)
59
Rob Mohrc70366e2019-11-18 11:09:39 -080060pw_cc_test(
Rob Mohr75e5fc92019-11-14 09:16:03 -080061 name = "type_to_string_test",
62 srcs = ["type_to_string_test.cc"],
Rob Mohr06819482020-04-06 13:25:43 -070063 deps = [
64 ":pw_string",
65 "//pw_unit_test",
66 ],
Rob Mohr75e5fc92019-11-14 09:16:03 -080067)
Rob Mohrcf185b42019-11-14 10:23:28 -080068
Rob Mohrc70366e2019-11-18 11:09:39 -080069pw_cc_test(
Wyatt Heplerce9b9522019-11-11 10:45:48 -080070 name = "string_builder_test",
71 srcs = ["string_builder_test.cc"],
72 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070073 ":pw_string",
74 "//pw_unit_test",
Wyatt Heplerce9b9522019-11-11 10:45:48 -080075 ],
76)
77
78pw_cc_test(
Rob Mohrcf185b42019-11-14 10:23:28 -080079 name = "to_string_test",
80 srcs = ["to_string_test.cc"],
Rob Mohr905d6282019-11-18 14:24:30 -080081 deps = [
Rob Mohr06819482020-04-06 13:25:43 -070082 ":pw_string",
Rob Mohr905d6282019-11-18 14:24:30 -080083 "//pw_status",
Rob Mohr06819482020-04-06 13:25:43 -070084 "//pw_unit_test",
Rob Mohr905d6282019-11-18 14:24:30 -080085 ],
Rob Mohrcf185b42019-11-14 10:23:28 -080086)
Rob Mohr3895a122019-12-02 11:49:18 -080087
88pw_cc_test(
89 name = "util_test",
90 srcs = ["util_test.cc"],
Rob Mohr06819482020-04-06 13:25:43 -070091 deps = [
92 ":pw_string",
93 "//pw_unit_test",
94 ],
Rob Mohr3895a122019-12-02 11:49:18 -080095)