forked from google/pigweed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
297 lines (268 loc) · 7.08 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# Copyright 2022 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
pw_add_module_config(pw_bluetooth_CONFIG)
pw_add_library(pw_bluetooth.config INTERFACE
HEADERS
public/pw_bluetooth/config.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
${pw_bluetooth_CONFIG}
)
pw_add_library(pw_bluetooth INTERFACE
HEADERS
public/pw_bluetooth/address.h
public/pw_bluetooth/assigned_uuids.h
public/pw_bluetooth/gatt/client.h
public/pw_bluetooth/gatt/constants.h
public/pw_bluetooth/gatt/error.h
public/pw_bluetooth/gatt/server.h
public/pw_bluetooth/gatt/types.h
public/pw_bluetooth/internal/hex.h
public/pw_bluetooth/internal/raii_ptr.h
public/pw_bluetooth/low_energy/advertising_data.h
public/pw_bluetooth/low_energy/bond_data.h
public/pw_bluetooth/low_energy/central.h
public/pw_bluetooth/low_energy/connection.h
public/pw_bluetooth/low_energy/peripheral.h
public/pw_bluetooth/low_energy/security_mode.h
public/pw_bluetooth/constants.h
public/pw_bluetooth/controller.h
public/pw_bluetooth/host.h
public/pw_bluetooth/pairing_delegate.h
public/pw_bluetooth/peer.h
public/pw_bluetooth/result.h
public/pw_bluetooth/types.h
public/pw_bluetooth/uuid.h
public/pw_bluetooth/vendor.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_containers
pw_function
pw_multibuf
pw_status
pw_string.string
pw_chrono.system_clock
)
pw_add_library(pw_bluetooth.pw_bluetooth2 INTERFACE
HEADERS
public/pw_bluetooth/address.h
public/pw_bluetooth/assigned_uuids.h
public/pw_bluetooth/constants.h
public/pw_bluetooth/config.h
public/pw_bluetooth/controller2.h
public/pw_bluetooth/gatt/client2.h
public/pw_bluetooth/gatt/constants.h
public/pw_bluetooth/gatt/error.h
public/pw_bluetooth/gatt/server2.h
public/pw_bluetooth/gatt/types.h
public/pw_bluetooth/internal/hex.h
public/pw_bluetooth/internal/raii_ptr.h
public/pw_bluetooth/low_energy/advertising_data.h
public/pw_bluetooth/low_energy/bond_data2.h
public/pw_bluetooth/low_energy/central2.h
public/pw_bluetooth/low_energy/channel.h
public/pw_bluetooth/low_energy/connection2.h
public/pw_bluetooth/low_energy/peripheral2.h
public/pw_bluetooth/low_energy/security_mode.h
public/pw_bluetooth/pairing_delegate2.h
public/pw_bluetooth/peer.h
public/pw_bluetooth/types.h
public/pw_bluetooth/uuid.h
public/pw_bluetooth/vendor.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_bluetooth.config
pw_async2.dispatcher
pw_async2.once_sender
pw_result.expected
pw_channel
pw_containers
pw_function
pw_multibuf
pw_result
pw_span
pw_status
)
pw_add_library(pw_bluetooth.emboss_util INTERFACE
HEADERS
public/pw_bluetooth/emboss_util.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_result
pw_span
pw_status
)
pw_add_test(pw_bluetooth.address_test
SOURCES
address_test.cc
PRIVATE_DEPS
pw_bluetooth
GROUPS
modules
)
pw_add_test(pw_bluetooth.api_test
SOURCES
api_test.cc
PRIVATE_DEPS
pw_bluetooth
GROUPS
modules
)
pw_add_test(pw_bluetooth.api2_test
SOURCES
api2_test.cc
PRIVATE_DEPS
pw_bluetooth.pw_bluetooth2
GROUPS
modules
)
pw_add_test(pw_bluetooth.result_test
SOURCES
result_test.cc
PRIVATE_DEPS
pw_bluetooth
GROUPS
modules
)
pw_add_test(pw_bluetooth.uuid_test
SOURCES
uuid_test.cc
PRIVATE_DEPS
pw_bluetooth
GROUPS
modules
)
###############################################################################
## Everything below here is intended to be emboss only ##
## and will be skipped if emboss isn't enabled. ##
###############################################################################
if("${dir_pw_third_party_emboss}" STREQUAL "")
# Skip emboss defs if it's not configured
return()
endif()
include($ENV{PW_ROOT}/third_party/emboss/emboss.cmake)
emboss_cc_library(pw_bluetooth.emboss_hci_common
SOURCES
public/pw_bluetooth/hci_common.emb
)
emboss_cc_library(pw_bluetooth.emboss_hci_android
SOURCES
public/pw_bluetooth/hci_android.emb
IMPORT_DIRS
public
DEPS
pw_bluetooth.emboss_hci_common
)
emboss_cc_library(pw_bluetooth.emboss_hci_commands
SOURCES
public/pw_bluetooth/hci_commands.emb
IMPORT_DIRS
public
DEPS
pw_bluetooth.emboss_hci_common
)
emboss_cc_library(pw_bluetooth.emboss_hci_events
SOURCES
public/pw_bluetooth/hci_events.emb
IMPORT_DIRS
public
DEPS
pw_bluetooth.emboss_hci_common
)
emboss_cc_library(pw_bluetooth.emboss_hci_h4
SOURCES
public/pw_bluetooth/hci_h4.emb
IMPORT_DIRS
public
)
emboss_cc_library(pw_bluetooth.emboss_hci_data
SOURCES
public/pw_bluetooth/hci_data.emb
)
emboss_cc_library(pw_bluetooth.emboss_l2cap_frames
SOURCES
public/pw_bluetooth/l2cap_frames.emb
)
emboss_cc_library(pw_bluetooth.emboss_rfcomm_frames
SOURCES
public/pw_bluetooth/rfcomm_frames.emb
)
emboss_cc_library(pw_bluetooth.emboss_att
SOURCES
public/pw_bluetooth/att.emb
IMPORT_DIRS
public
DEPS
pw_bluetooth.emboss_hci_data
pw_bluetooth.emboss_l2cap_frames
)
emboss_cc_library(pw_bluetooth.emboss_hci_test
SOURCES
public/pw_bluetooth/hci_test.emb
IMPORT_DIRS
public
DEPS
pw_bluetooth.emboss_hci_common
pw_bluetooth.emboss_l2cap_frames
)
pw_add_library("pw_bluetooth.emboss_hci_group" INTERFACE
PUBLIC_DEPS
pw_bluetooth.emboss_hci_android
pw_bluetooth.emboss_hci_commands
pw_bluetooth.emboss_hci_common
pw_bluetooth.emboss_hci_data
pw_bluetooth.emboss_hci_events
pw_bluetooth.emboss_hci_h4
)
pw_target_link_targets("pw_bluetooth._public_config"
INTERFACE
pw_bluetooth.emboss_att
pw_bluetooth.emboss_hci_android
pw_bluetooth.emboss_hci_commands
pw_bluetooth.emboss_hci_common
pw_bluetooth.emboss_hci_data
pw_bluetooth.emboss_hci_events
pw_bluetooth.emboss_hci_h4
pw_bluetooth.emboss_l2cap_frames
pw_bluetooth.emboss_rfcomm_frames
)
pw_add_test(pw_bluetooth.emboss_test
SOURCES
emboss_test.cc
PRIVATE_DEPS
# All emboss targets are listed (even if they don't have explicit tests) to
# ensure they are compiled.
pw_bluetooth.emboss_att
pw_bluetooth.emboss_hci_group
pw_bluetooth.emboss_hci_test
pw_bluetooth.emboss_l2cap_frames
pw_bluetooth.emboss_rfcomm_frames
pw_third_party.fuchsia.stdcompat
GROUPS
modules
)
pw_add_test(pw_bluetooth.emboss_util_test
SOURCES
emboss_util_test.cc
PRIVATE_DEPS
pw_bluetooth.emboss_hci_test
pw_bluetooth.emboss_util
GROUPS
modules
)