• 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
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
17pw_add_library(pw_bluetooth INTERFACE
18  HEADERS
19    public/pw_bluetooth/address.h
20    public/pw_bluetooth/assigned_uuids.h
21    public/pw_bluetooth/gatt/client.h
22    public/pw_bluetooth/gatt/constants.h
23    public/pw_bluetooth/gatt/error.h
24    public/pw_bluetooth/gatt/server.h
25    public/pw_bluetooth/gatt/types.h
26    public/pw_bluetooth/internal/hex.h
27    public/pw_bluetooth/internal/raii_ptr.h
28    public/pw_bluetooth/low_energy/advertising_data.h
29    public/pw_bluetooth/low_energy/bond_data.h
30    public/pw_bluetooth/low_energy/central.h
31    public/pw_bluetooth/low_energy/connection.h
32    public/pw_bluetooth/low_energy/peripheral.h
33    public/pw_bluetooth/low_energy/security_mode.h
34    public/pw_bluetooth/constants.h
35    public/pw_bluetooth/controller.h
36    public/pw_bluetooth/host.h
37    public/pw_bluetooth/pairing_delegate.h
38    public/pw_bluetooth/peer.h
39    public/pw_bluetooth/result.h
40    public/pw_bluetooth/types.h
41    public/pw_bluetooth/uuid.h
42    public/pw_bluetooth/vendor.h
43  PUBLIC_INCLUDES
44    public
45  PUBLIC_DEPS
46    pw_containers
47    pw_function
48    pw_status
49    pw_string.string
50    pw_chrono.system_clock
51)
52
53pw_add_test(pw_bluetooth.address_test
54  SOURCES
55    address_test.cc
56  PRIVATE_DEPS
57    pw_bluetooth
58  GROUPS
59    modules
60)
61
62pw_add_test(pw_bluetooth.api_test
63  SOURCES
64    api_test.cc
65  PRIVATE_DEPS
66    pw_bluetooth
67  GROUPS
68    modules
69)
70
71pw_add_test(pw_bluetooth.result_test
72  SOURCES
73    result_test.cc
74  PRIVATE_DEPS
75    pw_bluetooth
76  GROUPS
77    modules
78)
79
80pw_add_test(pw_bluetooth.uuid_test
81  SOURCES
82    uuid_test.cc
83  PRIVATE_DEPS
84    pw_bluetooth
85  GROUPS
86    modules
87)
88
89###############################################################################
90##          Everything below here is intended to be emboss only              ##
91##          and will be skipped if emboss isn't enabled.                     ##
92###############################################################################
93if("${dir_pw_third_party_emboss}" STREQUAL "")
94  # Skip emboss defs if it's not configured
95  return()
96endif()
97
98include($ENV{PW_ROOT}/third_party/emboss/emboss.cmake)
99
100emboss_cc_library(pw_bluetooth.emboss_hci_common
101  SOURCES
102    public/pw_bluetooth/hci_common.emb
103)
104
105emboss_cc_library(pw_bluetooth.emboss_hci_android
106  SOURCES
107    public/pw_bluetooth/hci_android.emb
108  IMPORT_DIRS
109    public
110  DEPS
111    pw_bluetooth.emboss_hci_common
112)
113
114emboss_cc_library(pw_bluetooth.emboss_hci_commands
115  SOURCES
116    public/pw_bluetooth/hci_commands.emb
117  IMPORT_DIRS
118    public
119  DEPS
120    pw_bluetooth.emboss_hci_common
121)
122
123emboss_cc_library(pw_bluetooth.emboss_hci_events
124  SOURCES
125    public/pw_bluetooth/hci_events.emb
126  IMPORT_DIRS
127    public
128  DEPS
129    pw_bluetooth.emboss_hci_common
130)
131
132emboss_cc_library(pw_bluetooth.emboss_hci_h4
133  SOURCES
134    public/pw_bluetooth/hci_h4.emb
135  IMPORT_DIRS
136    public
137)
138
139emboss_cc_library(pw_bluetooth.emboss_hci_data
140  SOURCES
141    public/pw_bluetooth/hci_data.emb
142)
143
144emboss_cc_library(pw_bluetooth.emboss_l2cap_frames
145  SOURCES
146    public/pw_bluetooth/l2cap_frames.emb
147)
148
149emboss_cc_library(pw_bluetooth.emboss_hci_test
150  SOURCES
151    public/pw_bluetooth/hci_test.emb
152  IMPORT_DIRS
153    public
154  DEPS
155    pw_bluetooth.emboss_hci_common
156    pw_bluetooth.emboss_l2cap_frames
157)
158
159pw_add_library("pw_bluetooth.emboss_hci_group" INTERFACE
160  PUBLIC_DEPS
161    pw_bluetooth.emboss_hci_android
162    pw_bluetooth.emboss_hci_commands
163    pw_bluetooth.emboss_hci_common
164    pw_bluetooth.emboss_hci_data
165    pw_bluetooth.emboss_hci_events
166    pw_bluetooth.emboss_hci_h4
167)
168
169pw_target_link_targets("pw_bluetooth._public_config"
170  INTERFACE
171    pw_bluetooth.emboss_hci_android
172    pw_bluetooth.emboss_hci_commands
173    pw_bluetooth.emboss_hci_common
174    pw_bluetooth.emboss_hci_data
175    pw_bluetooth.emboss_hci_events
176    pw_bluetooth.emboss_hci_h4
177    pw_bluetooth.emboss_l2cap_frames
178)
179
180pw_add_test(pw_bluetooth.emboss_test
181  SOURCES
182    emboss_test.cc
183  PRIVATE_DEPS
184
185    # All emboss targets are listed (even if they don't have explicit tests) to
186    # ensure they are compiled.
187    pw_bluetooth.emboss_hci_group
188    pw_bluetooth.emboss_hci_test
189    pw_bluetooth.emboss_l2cap_frames
190    pw_third_party.fuchsia.stdcompat
191  GROUPS
192    modules
193)
194