xref: /aosp_15_r20/external/pigweed/pw_bytes/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker# Copyright 2021 The Pigweed Authors
2*61c4878aSAndroid Build Coastguard Worker#
3*61c4878aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4*61c4878aSAndroid Build Coastguard Worker# use this file except in compliance with the License. You may obtain a copy of
5*61c4878aSAndroid Build Coastguard Worker# the License at
6*61c4878aSAndroid Build Coastguard Worker#
7*61c4878aSAndroid Build Coastguard Worker#     https://www.apache.org/licenses/LICENSE-2.0
8*61c4878aSAndroid Build Coastguard Worker#
9*61c4878aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*61c4878aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11*61c4878aSAndroid Build Coastguard Worker# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12*61c4878aSAndroid Build Coastguard Worker# License for the specific language governing permissions and limitations under
13*61c4878aSAndroid Build Coastguard Worker# the License.
14*61c4878aSAndroid Build Coastguard Worker
15*61c4878aSAndroid Build Coastguard Workerload("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
16*61c4878aSAndroid Build Coastguard Worker
17*61c4878aSAndroid Build Coastguard Workerpackage(default_visibility = ["//visibility:public"])
18*61c4878aSAndroid Build Coastguard Worker
19*61c4878aSAndroid Build Coastguard Workerlicenses(["notice"])
20*61c4878aSAndroid Build Coastguard Worker
21*61c4878aSAndroid Build Coastguard Workercc_library(
22*61c4878aSAndroid Build Coastguard Worker    name = "pw_bytes",
23*61c4878aSAndroid Build Coastguard Worker    srcs = [
24*61c4878aSAndroid Build Coastguard Worker        "byte_builder.cc",
25*61c4878aSAndroid Build Coastguard Worker    ],
26*61c4878aSAndroid Build Coastguard Worker    hdrs = [
27*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/array.h",
28*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/byte_builder.h",
29*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/endian.h",
30*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/span.h",
31*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/suffix.h",
32*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/units.h",
33*61c4878aSAndroid Build Coastguard Worker    ],
34*61c4878aSAndroid Build Coastguard Worker    strip_include_prefix = "public",
35*61c4878aSAndroid Build Coastguard Worker    deps = [
36*61c4878aSAndroid Build Coastguard Worker        ":bit",
37*61c4878aSAndroid Build Coastguard Worker        "//pw_containers:iterator",
38*61c4878aSAndroid Build Coastguard Worker        "//pw_polyfill",
39*61c4878aSAndroid Build Coastguard Worker        "//pw_preprocessor",
40*61c4878aSAndroid Build Coastguard Worker        "//pw_span",
41*61c4878aSAndroid Build Coastguard Worker        "//pw_status",
42*61c4878aSAndroid Build Coastguard Worker    ],
43*61c4878aSAndroid Build Coastguard Worker)
44*61c4878aSAndroid Build Coastguard Worker
45*61c4878aSAndroid Build Coastguard Workercc_library(
46*61c4878aSAndroid Build Coastguard Worker    name = "alignment",
47*61c4878aSAndroid Build Coastguard Worker    srcs = [
48*61c4878aSAndroid Build Coastguard Worker        "alignment.cc",
49*61c4878aSAndroid Build Coastguard Worker    ],
50*61c4878aSAndroid Build Coastguard Worker    hdrs = ["public/pw_bytes/alignment.h"],
51*61c4878aSAndroid Build Coastguard Worker    strip_include_prefix = "public",
52*61c4878aSAndroid Build Coastguard Worker    deps = [
53*61c4878aSAndroid Build Coastguard Worker        "//pw_assert",
54*61c4878aSAndroid Build Coastguard Worker        "//pw_bytes",
55*61c4878aSAndroid Build Coastguard Worker        "//pw_preprocessor",
56*61c4878aSAndroid Build Coastguard Worker        "//third_party/fuchsia:stdcompat",
57*61c4878aSAndroid Build Coastguard Worker    ],
58*61c4878aSAndroid Build Coastguard Worker)
59*61c4878aSAndroid Build Coastguard Worker
60*61c4878aSAndroid Build Coastguard Workercc_library(
61*61c4878aSAndroid Build Coastguard Worker    name = "bit",
62*61c4878aSAndroid Build Coastguard Worker    hdrs = ["public/pw_bytes/bit.h"],
63*61c4878aSAndroid Build Coastguard Worker    strip_include_prefix = "public",
64*61c4878aSAndroid Build Coastguard Worker    deps = ["//third_party/fuchsia:stdcompat"],
65*61c4878aSAndroid Build Coastguard Worker)
66*61c4878aSAndroid Build Coastguard Worker
67*61c4878aSAndroid Build Coastguard Workercc_library(
68*61c4878aSAndroid Build Coastguard Worker    name = "packed_ptr",
69*61c4878aSAndroid Build Coastguard Worker    hdrs = ["public/pw_bytes/packed_ptr.h"],
70*61c4878aSAndroid Build Coastguard Worker    strip_include_prefix = "public",
71*61c4878aSAndroid Build Coastguard Worker    deps = [
72*61c4878aSAndroid Build Coastguard Worker        "//pw_assert",
73*61c4878aSAndroid Build Coastguard Worker        "//third_party/fuchsia:stdcompat",
74*61c4878aSAndroid Build Coastguard Worker    ],
75*61c4878aSAndroid Build Coastguard Worker)
76*61c4878aSAndroid Build Coastguard Worker
77*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
78*61c4878aSAndroid Build Coastguard Worker    name = "alignment_test",
79*61c4878aSAndroid Build Coastguard Worker    srcs = ["alignment_test.cc"],
80*61c4878aSAndroid Build Coastguard Worker    deps = [
81*61c4878aSAndroid Build Coastguard Worker        ":alignment",
82*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
83*61c4878aSAndroid Build Coastguard Worker    ],
84*61c4878aSAndroid Build Coastguard Worker)
85*61c4878aSAndroid Build Coastguard Worker
86*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
87*61c4878aSAndroid Build Coastguard Worker    name = "array_test",
88*61c4878aSAndroid Build Coastguard Worker    srcs = ["array_test.cc"],
89*61c4878aSAndroid Build Coastguard Worker    deps = [
90*61c4878aSAndroid Build Coastguard Worker        ":pw_bytes",
91*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
92*61c4878aSAndroid Build Coastguard Worker    ],
93*61c4878aSAndroid Build Coastguard Worker)
94*61c4878aSAndroid Build Coastguard Worker
95*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
96*61c4878aSAndroid Build Coastguard Worker    name = "bit_test",
97*61c4878aSAndroid Build Coastguard Worker    srcs = ["bit_test.cc"],
98*61c4878aSAndroid Build Coastguard Worker    deps = [
99*61c4878aSAndroid Build Coastguard Worker        ":bit",
100*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
101*61c4878aSAndroid Build Coastguard Worker    ],
102*61c4878aSAndroid Build Coastguard Worker)
103*61c4878aSAndroid Build Coastguard Worker
104*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
105*61c4878aSAndroid Build Coastguard Worker    name = "byte_builder_test",
106*61c4878aSAndroid Build Coastguard Worker    srcs = ["byte_builder_test.cc"],
107*61c4878aSAndroid Build Coastguard Worker    deps = [
108*61c4878aSAndroid Build Coastguard Worker        ":pw_bytes",
109*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
110*61c4878aSAndroid Build Coastguard Worker    ],
111*61c4878aSAndroid Build Coastguard Worker)
112*61c4878aSAndroid Build Coastguard Worker
113*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
114*61c4878aSAndroid Build Coastguard Worker    name = "endian_test",
115*61c4878aSAndroid Build Coastguard Worker    srcs = ["endian_test.cc"],
116*61c4878aSAndroid Build Coastguard Worker    deps = [
117*61c4878aSAndroid Build Coastguard Worker        ":pw_bytes",
118*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
119*61c4878aSAndroid Build Coastguard Worker    ],
120*61c4878aSAndroid Build Coastguard Worker)
121*61c4878aSAndroid Build Coastguard Worker
122*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
123*61c4878aSAndroid Build Coastguard Worker    name = "packed_ptr_test",
124*61c4878aSAndroid Build Coastguard Worker    srcs = ["packed_ptr_test.cc"],
125*61c4878aSAndroid Build Coastguard Worker    deps = [
126*61c4878aSAndroid Build Coastguard Worker        ":packed_ptr",
127*61c4878aSAndroid Build Coastguard Worker        "//pw_compilation_testing:negative_compilation_testing",
128*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
129*61c4878aSAndroid Build Coastguard Worker    ],
130*61c4878aSAndroid Build Coastguard Worker)
131*61c4878aSAndroid Build Coastguard Worker
132*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
133*61c4878aSAndroid Build Coastguard Worker    name = "suffix_test",
134*61c4878aSAndroid Build Coastguard Worker    srcs = ["suffix_test.cc"],
135*61c4878aSAndroid Build Coastguard Worker    deps = [
136*61c4878aSAndroid Build Coastguard Worker        ":pw_bytes",
137*61c4878aSAndroid Build Coastguard Worker        "//pw_compilation_testing:negative_compilation_testing",
138*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
139*61c4878aSAndroid Build Coastguard Worker    ],
140*61c4878aSAndroid Build Coastguard Worker)
141*61c4878aSAndroid Build Coastguard Worker
142*61c4878aSAndroid Build Coastguard Workerpw_cc_test(
143*61c4878aSAndroid Build Coastguard Worker    name = "units_test",
144*61c4878aSAndroid Build Coastguard Worker    srcs = ["units_test.cc"],
145*61c4878aSAndroid Build Coastguard Worker    deps = [
146*61c4878aSAndroid Build Coastguard Worker        ":pw_bytes",
147*61c4878aSAndroid Build Coastguard Worker        "//pw_unit_test",
148*61c4878aSAndroid Build Coastguard Worker    ],
149*61c4878aSAndroid Build Coastguard Worker)
150*61c4878aSAndroid Build Coastguard Worker
151*61c4878aSAndroid Build Coastguard Workerfilegroup(
152*61c4878aSAndroid Build Coastguard Worker    name = "doxygen",
153*61c4878aSAndroid Build Coastguard Worker    srcs = [
154*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/alignment.h",
155*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/bit.h",
156*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/byte_builder.h",
157*61c4878aSAndroid Build Coastguard Worker        "public/pw_bytes/packed_ptr.h",
158*61c4878aSAndroid Build Coastguard Worker    ],
159*61c4878aSAndroid Build Coastguard Worker)
160