xref: /aosp_15_r20/external/pigweed/pw_bluetooth_sapphire/host/common/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2023 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
15import("//build_overrides/pigweed.gni")
16import("$dir_pw_fuzzer/fuzzer.gni")
17import("$dir_pw_unit_test/test.gni")
18
19dir_public_common = "../../public/pw_bluetooth_sapphire/internal/host/common"
20
21pw_source_set("common") {
22  public = [
23    "$dir_public_common/advertising_data.h",
24    "$dir_public_common/assert.h",
25    "$dir_public_common/bounded_inspect_list_node.h",
26    "$dir_public_common/byte_buffer.h",
27    "$dir_public_common/device_address.h",
28    "$dir_public_common/device_class.h",
29    "$dir_public_common/error.h",
30    "$dir_public_common/expiring_set.h",
31    "$dir_public_common/fake_inspect.h",
32    "$dir_public_common/host_error.h",
33    "$dir_public_common/identifier.h",
34    "$dir_public_common/inspect.h",
35    "$dir_public_common/inspectable.h",
36    "$dir_public_common/log.h",
37    "$dir_public_common/macros.h",
38    "$dir_public_common/manufacturer_names.h",
39    "$dir_public_common/metrics.h",
40    "$dir_public_common/packet_view.h",
41    "$dir_public_common/pipeline_monitor.h",
42    "$dir_public_common/random.h",
43    "$dir_public_common/retire_log.h",
44    "$dir_public_common/slab_allocator.h",
45    "$dir_public_common/slab_buffer.h",
46    "$dir_public_common/smart_task.h",
47    "$dir_public_common/supplement_data.h",
48    "$dir_public_common/to_string.h",
49    "$dir_public_common/trace.h",
50    "$dir_public_common/uint128.h",
51    "$dir_public_common/uint256.h",
52    "$dir_public_common/uuid.h",
53    "$dir_public_common/weak_self.h",
54    "$dir_public_common/windowed_inspect_numeric_property.h",
55  ]
56
57  sources = [
58    "advertising_data.cc",
59    "bounded_inspect_list_node.cc",
60    "byte_buffer.cc",
61    "device_address.cc",
62    "device_class.cc",
63    "host_error.cc",
64    "identifier.cc",
65    "log.cc",
66    "manufacturer_names.cc",
67    "metrics.cc",
68    "random.cc",
69    "retire_log.cc",
70    "slab_allocator.cc",
71    "supplement_data.cc",
72    "uuid.cc",
73  ]
74
75  public_deps = [
76    "$dir_pw_assert",
77    "$dir_pw_async:dispatcher",
78    "$dir_pw_async:task",
79    "$dir_pw_bluetooth:emboss_hci_group",
80    "$dir_pw_bluetooth_sapphire:config",
81    "$dir_pw_bluetooth_sapphire/lib/cpp-string",
82    "$dir_pw_bluetooth_sapphire/lib/cpp-type",
83    "$dir_pw_intrusive_ptr",
84    "$dir_pw_log",
85    "$dir_pw_random",
86    "$dir_pw_span",
87    "$dir_pw_string",
88    "$dir_pw_string:utf_codecs",
89    "$dir_pw_third_party/fuchsia:fit",
90  ]
91
92  if (current_os == "fuchsia") {
93    public_deps += [
94      "//sdk/lib/sys/inspect/cpp",
95      "//zircon/system/ulib/trace",
96    ]
97  }
98
99  deps = [ "$dir_pw_preprocessor" ]
100}
101
102pw_source_set("uuid_string_util") {
103  sources = [ "uuid_string_util.cc" ]
104  public_deps = [ ":common" ]
105}
106
107pw_test("common_tests") {
108  sources = [
109    "advertising_data_test.cc",
110    "bounded_inspect_list_node_test.cc",
111    "byte_buffer_test.cc",
112    "device_address_test.cc",
113    "device_class_test.cc",
114    "error_test.cc",
115    "expiring_set_test.cc",
116    "identifier_test.cc",
117    "inspectable_test.cc",
118    "manufacturer_names_test.cc",
119    "metrics_test.cc",
120    "packet_view_test.cc",
121    "pipeline_monitor_test.cc",
122    "retire_log_test.cc",
123    "slab_allocator_test.cc",
124    "supplement_data_test.cc",
125    "uuid_test.cc",
126    "weak_self_test.cc",
127    "windowed_inspect_numeric_property_test.cc",
128  ]
129
130  deps = [
131    ":common",
132    ":uuid_string_util",
133    "$dir_pw_async:fake_dispatcher_fixture",
134    "$dir_pw_bluetooth_sapphire/host/testing",
135  ]
136
137  test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main"
138}
139
140pw_fuzzer("advertising_data_fuzzer") {
141  sources = [ "advertising_data_fuzztest.cc" ]
142  deps = [ ":common" ]
143}
144
145pw_test_group("tests") {
146  tests = [
147    ":common_tests",
148    ":advertising_data_fuzzer_test",
149  ]
150}
151