• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = "pw_bytes",
26    srcs = [
27        "byte_builder.cc",
28    ],
29    hdrs = [
30        "public/pw_bytes/array.h",
31        "public/pw_bytes/byte_builder.h",
32        "public/pw_bytes/endian.h",
33        "public/pw_bytes/span.h",
34        "public/pw_bytes/suffix.h",
35        "public/pw_bytes/units.h",
36    ],
37    includes = ["public"],
38    deps = [
39        ":bit",
40        "//pw_containers:iterator",
41        "//pw_polyfill",
42        "//pw_preprocessor",
43        "//pw_span",
44        "//pw_status",
45    ],
46)
47
48cc_library(
49    name = "alignment",
50    srcs = [
51        "alignment.cc",
52    ],
53    hdrs = ["public/pw_bytes/alignment.h"],
54    includes = ["public"],
55    deps = [
56        "//pw_assert",
57        "//pw_bytes",
58        "//pw_preprocessor",
59    ],
60)
61
62cc_library(
63    name = "bit",
64    hdrs = ["public/pw_bytes/bit.h"],
65    includes = ["public"],
66    deps = ["//third_party/fuchsia:stdcompat"],
67)
68
69pw_cc_test(
70    name = "alignment_test",
71    srcs = ["alignment_test.cc"],
72    deps = [
73        ":alignment",
74        "//pw_unit_test",
75    ],
76)
77
78pw_cc_test(
79    name = "array_test",
80    srcs = ["array_test.cc"],
81    deps = [
82        ":pw_bytes",
83        "//pw_unit_test",
84    ],
85)
86
87pw_cc_test(
88    name = "bit_test",
89    srcs = ["bit_test.cc"],
90    deps = [
91        ":bit",
92        "//pw_unit_test",
93    ],
94)
95
96pw_cc_test(
97    name = "byte_builder_test",
98    srcs = ["byte_builder_test.cc"],
99    deps = [
100        ":pw_bytes",
101        "//pw_unit_test",
102    ],
103)
104
105pw_cc_test(
106    name = "endian_test",
107    srcs = ["endian_test.cc"],
108    deps = [
109        ":pw_bytes",
110        "//pw_unit_test",
111    ],
112)
113
114pw_cc_test(
115    name = "suffix_test",
116    srcs = ["suffix_test.cc"],
117    deps = [
118        ":pw_bytes",
119        "//pw_compilation_testing:negative_compilation_testing",
120    ],
121)
122
123pw_cc_test(
124    name = "units_test",
125    srcs = ["units_test.cc"],
126    deps = [
127        ":pw_bytes",
128    ],
129)
130