• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("@com_google_emboss//:build_defs.bzl", "emboss_cc_library")
16load(
17    "//pw_build:pigweed.bzl",
18    "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])
24
25cc_library(
26    name = "pw_bluetooth",
27    hdrs = [
28        "public/pw_bluetooth/address.h",
29        "public/pw_bluetooth/assigned_uuids.h",
30        "public/pw_bluetooth/constants.h",
31        "public/pw_bluetooth/controller.h",
32        "public/pw_bluetooth/gatt/client.h",
33        "public/pw_bluetooth/gatt/constants.h",
34        "public/pw_bluetooth/gatt/error.h",
35        "public/pw_bluetooth/gatt/server.h",
36        "public/pw_bluetooth/gatt/types.h",
37        "public/pw_bluetooth/host.h",
38        "public/pw_bluetooth/internal/hex.h",
39        "public/pw_bluetooth/internal/raii_ptr.h",
40        "public/pw_bluetooth/low_energy/advertising_data.h",
41        "public/pw_bluetooth/low_energy/bond_data.h",
42        "public/pw_bluetooth/low_energy/central.h",
43        "public/pw_bluetooth/low_energy/connection.h",
44        "public/pw_bluetooth/low_energy/peripheral.h",
45        "public/pw_bluetooth/low_energy/security_mode.h",
46        "public/pw_bluetooth/pairing_delegate.h",
47        "public/pw_bluetooth/peer.h",
48        "public/pw_bluetooth/result.h",
49        "public/pw_bluetooth/types.h",
50        "public/pw_bluetooth/uuid.h",
51        "public/pw_bluetooth/vendor.h",
52    ],
53    includes = ["public"],
54    deps = [
55        "//pw_chrono:system_clock",
56        "//pw_containers",
57        "//pw_function",
58        "//pw_status",
59        "//pw_string:string",
60    ],
61)
62
63pw_cc_test(
64    name = "address_test",
65    srcs = [
66        "address_test.cc",
67    ],
68    deps = [
69        ":pw_bluetooth",
70    ],
71)
72
73pw_cc_test(
74    name = "api_test",
75    srcs = [
76        "api_test.cc",
77    ],
78    deps = [
79        ":pw_bluetooth",
80    ],
81)
82
83pw_cc_test(
84    name = "result_test",
85    srcs = [
86        "result_test.cc",
87    ],
88    deps = [
89        ":pw_bluetooth",
90    ],
91)
92
93pw_cc_test(
94    name = "uuid_test",
95    srcs = [
96        "uuid_test.cc",
97    ],
98    deps = [
99        ":pw_bluetooth",
100    ],
101)
102
103emboss_cc_library(
104    name = "_emboss_hci_android",
105    srcs = ["public/pw_bluetooth/hci_android.emb"],
106    enable_enum_traits = False,
107    import_dirs = ["public"],
108    visibility = ["//visibility:private"],
109    deps = [":_emboss_hci_common"],
110)
111
112# emboss_cc_library doesn't support includes, so we need to wrap it.
113cc_library(
114    name = "emboss_hci_android",
115    includes = ["public"],
116    deps = [":_emboss_hci_android"],
117)
118
119emboss_cc_library(
120    name = "_emboss_hci_common",
121    srcs = ["public/pw_bluetooth/hci_common.emb"],
122    enable_enum_traits = False,
123    visibility = ["//visibility:private"],
124)
125
126cc_library(
127    name = "emboss_hci_common",
128    includes = ["public"],
129    deps = [":_emboss_hci_common"],
130)
131
132emboss_cc_library(
133    name = "_emboss_hci_commands",
134    srcs = ["public/pw_bluetooth/hci_commands.emb"],
135    enable_enum_traits = False,
136    import_dirs = ["public"],
137    visibility = ["//visibility:private"],
138    deps = [":_emboss_hci_common"],
139)
140
141cc_library(
142    name = "emboss_hci_commands",
143    includes = ["public"],
144    deps = [":_emboss_hci_commands"],
145)
146
147emboss_cc_library(
148    name = "_emboss_hci_data",
149    srcs = ["public/pw_bluetooth/hci_data.emb"],
150    enable_enum_traits = False,
151    visibility = ["//visibility:private"],
152    deps = [":_emboss_hci_common"],
153)
154
155cc_library(
156    name = "emboss_hci_data",
157    includes = ["public"],
158    deps = [":_emboss_hci_data"],
159)
160
161emboss_cc_library(
162    name = "_emboss_hci_events",
163    srcs = ["public/pw_bluetooth/hci_events.emb"],
164    enable_enum_traits = False,
165    import_dirs = ["public"],
166    visibility = ["//visibility:private"],
167    deps = [":_emboss_hci_common"],
168)
169
170cc_library(
171    name = "emboss_hci_events",
172    includes = ["public"],
173    deps = [":_emboss_hci_events"],
174)
175
176emboss_cc_library(
177    name = "_emboss_hci_h4",
178    srcs = ["public/pw_bluetooth/hci_h4.emb"],
179    enable_enum_traits = False,
180    import_dirs = ["public"],
181    visibility = ["//visibility:private"],
182)
183
184cc_library(
185    name = "emboss_hci_h4",
186    includes = ["public"],
187    deps = [":_emboss_hci_h4"],
188)
189
190emboss_cc_library(
191    name = "_emboss_hci_test",
192    srcs = ["public/pw_bluetooth/hci_test.emb"],
193    enable_enum_traits = False,
194    import_dirs = ["public"],
195    visibility = ["//visibility:private"],
196    deps = [":_emboss_hci_common"],
197)
198
199cc_library(
200    name = "emboss_hci_test",
201    includes = ["public"],
202    deps = [":_emboss_hci_test"],
203)
204
205emboss_cc_library(
206    name = "_emboss_l2cap_frames",
207    srcs = ["public/pw_bluetooth/l2cap_frames.emb"],
208    enable_enum_traits = False,
209    visibility = ["//visibility:private"],
210)
211
212cc_library(
213    name = "emboss_l2cap_frames",
214    includes = ["public"],
215    deps = [":_emboss_l2cap_frames"],
216)
217
218cc_library(
219    name = "emboss_hci",
220    deps = [
221        ":emboss_hci_android",
222        ":emboss_hci_commands",
223        ":emboss_hci_common",
224        ":emboss_hci_data",
225        ":emboss_hci_events",
226        ":emboss_hci_h4",
227    ],
228)
229
230pw_cc_test(
231    name = "emboss_test",
232    srcs = ["emboss_test.cc"],
233    deps = [
234        # All emboss targets are listed (even if they don't have explicit tests)
235        # to ensure they are compiled.
236        ":emboss_hci",
237        ":emboss_hci_test",
238        ":emboss_l2cap_frames",
239        "//third_party/fuchsia:stdcompat",
240    ],
241)
242
243# Bazel support for Emboss has not been fully configured yet, but we need to
244# satisfy presubmit.
245filegroup(
246    name = "emboss_files",
247    srcs = [
248        "size_report/make_2_views_and_write.cc",
249        "size_report/make_view_and_write.cc",
250    ],
251)
252