• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("//pw_fuzzer:fuzzer.bzl", "pw_cc_fuzz_test")
17load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
18
19package(
20    default_visibility = ["//visibility:public"],
21    features = ["-layering_check"],
22)
23
24cc_library(
25    name = "definitions",
26    srcs = [
27        "data_element.cc",
28        "error.cc",
29        "service_record.cc",
30    ],
31    hdrs = [
32        "public/pw_bluetooth_sapphire/internal/host/sdp/data_element.h",
33        "public/pw_bluetooth_sapphire/internal/host/sdp/error.h",
34        "public/pw_bluetooth_sapphire/internal/host/sdp/sdp.h",
35        "public/pw_bluetooth_sapphire/internal/host/sdp/service_record.h",
36    ],
37    strip_include_prefix = "public",
38    tags = ["noclangtidy"],
39    deps = [
40        "//pw_bluetooth_sapphire/host/common",
41    ],
42)
43
44cc_library(
45    name = "sdp",
46    srcs = [
47        "client.cc",
48        "pdu.cc",
49        "server.cc",
50        "service_discoverer.cc",
51    ],
52    hdrs = [
53        "public/pw_bluetooth_sapphire/internal/host/sdp/client.h",
54        "public/pw_bluetooth_sapphire/internal/host/sdp/pdu.h",
55        "public/pw_bluetooth_sapphire/internal/host/sdp/server.h",
56        "public/pw_bluetooth_sapphire/internal/host/sdp/service_discoverer.h",
57    ],
58    strip_include_prefix = "public",
59    tags = ["noclangtidy"],
60    deps = [
61        ":definitions",
62        "//pw_bluetooth_sapphire/host/l2cap",
63        "//third_party/fuchsia:fit",
64    ],
65)
66
67pw_cc_test(
68    name = "sdp_test",
69    srcs = [
70        "client_test.cc",
71        "data_element_test.cc",
72        "pdu_test.cc",
73        "server_test.cc",
74        "service_discoverer_test.cc",
75        "service_record_test.cc",
76    ],
77    test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main",
78    deps = [
79        ":sdp",
80        "//pw_bluetooth_sapphire/host/common",
81        "//pw_bluetooth_sapphire/host/l2cap:testing",
82        "//pw_bluetooth_sapphire/host/testing",
83        "//pw_bluetooth_sapphire/host/testing:fake_controller",
84        "//pw_bluetooth_sapphire/host/testing:gtest_helpers",
85        "//pw_bluetooth_sapphire/host/testing:test_helpers",
86    ],
87)
88
89pw_cc_fuzz_test(
90    name = "data_element_fuzzer",
91    srcs = ["data_element_fuzztest.cc"],
92    deps = [":definitions"],
93)
94
95pw_cc_fuzz_test(
96    name = "pdu_fuzzer",
97    srcs = ["pdu_fuzztest.cc"],
98    deps = [":sdp"],
99)
100