1*61c4878aSAndroid Build Coastguard Worker# Copyright 2022 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 Workerinclude($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16*61c4878aSAndroid Build Coastguard Worker 17*61c4878aSAndroid Build Coastguard Workerpw_add_module_config(pw_bluetooth_CONFIG) 18*61c4878aSAndroid Build Coastguard Worker 19*61c4878aSAndroid Build Coastguard Workerpw_add_library(pw_bluetooth.config INTERFACE 20*61c4878aSAndroid Build Coastguard Worker HEADERS 21*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/config.h 22*61c4878aSAndroid Build Coastguard Worker PUBLIC_INCLUDES 23*61c4878aSAndroid Build Coastguard Worker public 24*61c4878aSAndroid Build Coastguard Worker PUBLIC_DEPS 25*61c4878aSAndroid Build Coastguard Worker ${pw_bluetooth_CONFIG} 26*61c4878aSAndroid Build Coastguard Worker) 27*61c4878aSAndroid Build Coastguard Worker 28*61c4878aSAndroid Build Coastguard Workerpw_add_library(pw_bluetooth INTERFACE 29*61c4878aSAndroid Build Coastguard Worker HEADERS 30*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/address.h 31*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/assigned_uuids.h 32*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/client.h 33*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/constants.h 34*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/error.h 35*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/server.h 36*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/types.h 37*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/internal/hex.h 38*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/internal/raii_ptr.h 39*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/advertising_data.h 40*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/bond_data.h 41*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/central.h 42*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/connection.h 43*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/peripheral.h 44*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/security_mode.h 45*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/constants.h 46*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/controller.h 47*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/host.h 48*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/pairing_delegate.h 49*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/peer.h 50*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/result.h 51*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/types.h 52*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/uuid.h 53*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/vendor.h 54*61c4878aSAndroid Build Coastguard Worker PUBLIC_INCLUDES 55*61c4878aSAndroid Build Coastguard Worker public 56*61c4878aSAndroid Build Coastguard Worker PUBLIC_DEPS 57*61c4878aSAndroid Build Coastguard Worker pw_containers 58*61c4878aSAndroid Build Coastguard Worker pw_function 59*61c4878aSAndroid Build Coastguard Worker pw_multibuf 60*61c4878aSAndroid Build Coastguard Worker pw_status 61*61c4878aSAndroid Build Coastguard Worker pw_string.string 62*61c4878aSAndroid Build Coastguard Worker pw_chrono.system_clock 63*61c4878aSAndroid Build Coastguard Worker) 64*61c4878aSAndroid Build Coastguard Worker 65*61c4878aSAndroid Build Coastguard Workerpw_add_library(pw_bluetooth.pw_bluetooth2 INTERFACE 66*61c4878aSAndroid Build Coastguard Worker HEADERS 67*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/address.h 68*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/assigned_uuids.h 69*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/constants.h 70*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/config.h 71*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/controller2.h 72*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/client2.h 73*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/constants.h 74*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/error.h 75*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/server2.h 76*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/gatt/types.h 77*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/internal/hex.h 78*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/internal/raii_ptr.h 79*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/advertising_data.h 80*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/bond_data2.h 81*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/central2.h 82*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/channel.h 83*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/connection2.h 84*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/peripheral2.h 85*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/low_energy/security_mode.h 86*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/pairing_delegate2.h 87*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/peer.h 88*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/types.h 89*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/uuid.h 90*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/vendor.h 91*61c4878aSAndroid Build Coastguard Worker PUBLIC_INCLUDES 92*61c4878aSAndroid Build Coastguard Worker public 93*61c4878aSAndroid Build Coastguard Worker PUBLIC_DEPS 94*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.config 95*61c4878aSAndroid Build Coastguard Worker pw_async2.dispatcher 96*61c4878aSAndroid Build Coastguard Worker pw_async2.once_sender 97*61c4878aSAndroid Build Coastguard Worker pw_result.expected 98*61c4878aSAndroid Build Coastguard Worker pw_channel 99*61c4878aSAndroid Build Coastguard Worker pw_containers 100*61c4878aSAndroid Build Coastguard Worker pw_function 101*61c4878aSAndroid Build Coastguard Worker pw_multibuf 102*61c4878aSAndroid Build Coastguard Worker pw_result 103*61c4878aSAndroid Build Coastguard Worker pw_span 104*61c4878aSAndroid Build Coastguard Worker pw_status 105*61c4878aSAndroid Build Coastguard Worker) 106*61c4878aSAndroid Build Coastguard Worker 107*61c4878aSAndroid Build Coastguard Worker 108*61c4878aSAndroid Build Coastguard Workerpw_add_library(pw_bluetooth.emboss_util INTERFACE 109*61c4878aSAndroid Build Coastguard Worker HEADERS 110*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/emboss_util.h 111*61c4878aSAndroid Build Coastguard Worker PUBLIC_INCLUDES 112*61c4878aSAndroid Build Coastguard Worker public 113*61c4878aSAndroid Build Coastguard Worker PUBLIC_DEPS 114*61c4878aSAndroid Build Coastguard Worker pw_result 115*61c4878aSAndroid Build Coastguard Worker pw_span 116*61c4878aSAndroid Build Coastguard Worker pw_status 117*61c4878aSAndroid Build Coastguard Worker) 118*61c4878aSAndroid Build Coastguard Worker 119*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.address_test 120*61c4878aSAndroid Build Coastguard Worker SOURCES 121*61c4878aSAndroid Build Coastguard Worker address_test.cc 122*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 123*61c4878aSAndroid Build Coastguard Worker pw_bluetooth 124*61c4878aSAndroid Build Coastguard Worker GROUPS 125*61c4878aSAndroid Build Coastguard Worker modules 126*61c4878aSAndroid Build Coastguard Worker) 127*61c4878aSAndroid Build Coastguard Worker 128*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.api_test 129*61c4878aSAndroid Build Coastguard Worker SOURCES 130*61c4878aSAndroid Build Coastguard Worker api_test.cc 131*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 132*61c4878aSAndroid Build Coastguard Worker pw_bluetooth 133*61c4878aSAndroid Build Coastguard Worker GROUPS 134*61c4878aSAndroid Build Coastguard Worker modules 135*61c4878aSAndroid Build Coastguard Worker) 136*61c4878aSAndroid Build Coastguard Worker 137*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.api2_test 138*61c4878aSAndroid Build Coastguard Worker SOURCES 139*61c4878aSAndroid Build Coastguard Worker api2_test.cc 140*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 141*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.pw_bluetooth2 142*61c4878aSAndroid Build Coastguard Worker GROUPS 143*61c4878aSAndroid Build Coastguard Worker modules 144*61c4878aSAndroid Build Coastguard Worker) 145*61c4878aSAndroid Build Coastguard Worker 146*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.result_test 147*61c4878aSAndroid Build Coastguard Worker SOURCES 148*61c4878aSAndroid Build Coastguard Worker result_test.cc 149*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 150*61c4878aSAndroid Build Coastguard Worker pw_bluetooth 151*61c4878aSAndroid Build Coastguard Worker GROUPS 152*61c4878aSAndroid Build Coastguard Worker modules 153*61c4878aSAndroid Build Coastguard Worker) 154*61c4878aSAndroid Build Coastguard Worker 155*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.uuid_test 156*61c4878aSAndroid Build Coastguard Worker SOURCES 157*61c4878aSAndroid Build Coastguard Worker uuid_test.cc 158*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 159*61c4878aSAndroid Build Coastguard Worker pw_bluetooth 160*61c4878aSAndroid Build Coastguard Worker GROUPS 161*61c4878aSAndroid Build Coastguard Worker modules 162*61c4878aSAndroid Build Coastguard Worker) 163*61c4878aSAndroid Build Coastguard Worker 164*61c4878aSAndroid Build Coastguard Worker############################################################################### 165*61c4878aSAndroid Build Coastguard Worker## Everything below here is intended to be emboss only ## 166*61c4878aSAndroid Build Coastguard Worker## and will be skipped if emboss isn't enabled. ## 167*61c4878aSAndroid Build Coastguard Worker############################################################################### 168*61c4878aSAndroid Build Coastguard Workerif("${dir_pw_third_party_emboss}" STREQUAL "") 169*61c4878aSAndroid Build Coastguard Worker # Skip emboss defs if it's not configured 170*61c4878aSAndroid Build Coastguard Worker return() 171*61c4878aSAndroid Build Coastguard Workerendif() 172*61c4878aSAndroid Build Coastguard Worker 173*61c4878aSAndroid Build Coastguard Workerinclude($ENV{PW_ROOT}/third_party/emboss/emboss.cmake) 174*61c4878aSAndroid Build Coastguard Worker 175*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_common 176*61c4878aSAndroid Build Coastguard Worker SOURCES 177*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_common.emb 178*61c4878aSAndroid Build Coastguard Worker) 179*61c4878aSAndroid Build Coastguard Worker 180*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_android 181*61c4878aSAndroid Build Coastguard Worker SOURCES 182*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_android.emb 183*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 184*61c4878aSAndroid Build Coastguard Worker public 185*61c4878aSAndroid Build Coastguard Worker DEPS 186*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 187*61c4878aSAndroid Build Coastguard Worker) 188*61c4878aSAndroid Build Coastguard Worker 189*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_commands 190*61c4878aSAndroid Build Coastguard Worker SOURCES 191*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_commands.emb 192*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 193*61c4878aSAndroid Build Coastguard Worker public 194*61c4878aSAndroid Build Coastguard Worker DEPS 195*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 196*61c4878aSAndroid Build Coastguard Worker) 197*61c4878aSAndroid Build Coastguard Worker 198*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_events 199*61c4878aSAndroid Build Coastguard Worker SOURCES 200*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_events.emb 201*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 202*61c4878aSAndroid Build Coastguard Worker public 203*61c4878aSAndroid Build Coastguard Worker DEPS 204*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 205*61c4878aSAndroid Build Coastguard Worker) 206*61c4878aSAndroid Build Coastguard Worker 207*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_h4 208*61c4878aSAndroid Build Coastguard Worker SOURCES 209*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_h4.emb 210*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 211*61c4878aSAndroid Build Coastguard Worker public 212*61c4878aSAndroid Build Coastguard Worker) 213*61c4878aSAndroid Build Coastguard Worker 214*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_data 215*61c4878aSAndroid Build Coastguard Worker SOURCES 216*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_data.emb 217*61c4878aSAndroid Build Coastguard Worker) 218*61c4878aSAndroid Build Coastguard Worker 219*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_l2cap_frames 220*61c4878aSAndroid Build Coastguard Worker SOURCES 221*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/l2cap_frames.emb 222*61c4878aSAndroid Build Coastguard Worker) 223*61c4878aSAndroid Build Coastguard Worker 224*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_rfcomm_frames 225*61c4878aSAndroid Build Coastguard Worker SOURCES 226*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/rfcomm_frames.emb 227*61c4878aSAndroid Build Coastguard Worker) 228*61c4878aSAndroid Build Coastguard Worker 229*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_att 230*61c4878aSAndroid Build Coastguard Worker SOURCES 231*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/att.emb 232*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 233*61c4878aSAndroid Build Coastguard Worker public 234*61c4878aSAndroid Build Coastguard Worker DEPS 235*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_data 236*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_l2cap_frames 237*61c4878aSAndroid Build Coastguard Worker) 238*61c4878aSAndroid Build Coastguard Worker 239*61c4878aSAndroid Build Coastguard Workeremboss_cc_library(pw_bluetooth.emboss_hci_test 240*61c4878aSAndroid Build Coastguard Worker SOURCES 241*61c4878aSAndroid Build Coastguard Worker public/pw_bluetooth/hci_test.emb 242*61c4878aSAndroid Build Coastguard Worker IMPORT_DIRS 243*61c4878aSAndroid Build Coastguard Worker public 244*61c4878aSAndroid Build Coastguard Worker DEPS 245*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 246*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_l2cap_frames 247*61c4878aSAndroid Build Coastguard Worker) 248*61c4878aSAndroid Build Coastguard Worker 249*61c4878aSAndroid Build Coastguard Workerpw_add_library("pw_bluetooth.emboss_hci_group" INTERFACE 250*61c4878aSAndroid Build Coastguard Worker PUBLIC_DEPS 251*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_android 252*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_commands 253*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 254*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_data 255*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_events 256*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_h4 257*61c4878aSAndroid Build Coastguard Worker) 258*61c4878aSAndroid Build Coastguard Worker 259*61c4878aSAndroid Build Coastguard Workerpw_target_link_targets("pw_bluetooth._public_config" 260*61c4878aSAndroid Build Coastguard Worker INTERFACE 261*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_att 262*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_android 263*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_commands 264*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_common 265*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_data 266*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_events 267*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_h4 268*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_l2cap_frames 269*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_rfcomm_frames 270*61c4878aSAndroid Build Coastguard Worker) 271*61c4878aSAndroid Build Coastguard Worker 272*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.emboss_test 273*61c4878aSAndroid Build Coastguard Worker SOURCES 274*61c4878aSAndroid Build Coastguard Worker emboss_test.cc 275*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 276*61c4878aSAndroid Build Coastguard Worker 277*61c4878aSAndroid Build Coastguard Worker # All emboss targets are listed (even if they don't have explicit tests) to 278*61c4878aSAndroid Build Coastguard Worker # ensure they are compiled. 279*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_att 280*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_group 281*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_test 282*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_l2cap_frames 283*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_rfcomm_frames 284*61c4878aSAndroid Build Coastguard Worker pw_third_party.fuchsia.stdcompat 285*61c4878aSAndroid Build Coastguard Worker GROUPS 286*61c4878aSAndroid Build Coastguard Worker modules 287*61c4878aSAndroid Build Coastguard Worker) 288*61c4878aSAndroid Build Coastguard Worker 289*61c4878aSAndroid Build Coastguard Workerpw_add_test(pw_bluetooth.emboss_util_test 290*61c4878aSAndroid Build Coastguard Worker SOURCES 291*61c4878aSAndroid Build Coastguard Worker emboss_util_test.cc 292*61c4878aSAndroid Build Coastguard Worker PRIVATE_DEPS 293*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_hci_test 294*61c4878aSAndroid Build Coastguard Worker pw_bluetooth.emboss_util 295*61c4878aSAndroid Build Coastguard Worker GROUPS 296*61c4878aSAndroid Build Coastguard Worker modules 297*61c4878aSAndroid Build Coastguard Worker) 298