1#
2#  Copyright 2021 Google, Inc.
3#
4#  Licensed under the Apache License, Version 2.0 (the "License");
5#  you may not use this file except in compliance with the License.
6#  You may obtain a copy of the License at:
7#
8#  http://www.apache.org/licenses/LICENSE-2.0
9#
10#  Unless required by applicable law or agreed to in writing, software
11#  distributed under the License is distributed on an "AS IS" BASIS,
12#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#  See the License for the specific language governing permissions and
14#  limitations under the License.
15
16import("//bt/system/gd/dumpsys/bundler/bundler.gni")
17import("//bt/system/gd/packet/parser/packetgen.gni")
18import("//common-mk/flatbuffer.gni")
19
20config("gd_defaults") {
21  cflags_cc = [
22    "-DGOOGLE_PROTOBUF_NO_RTTI",
23    "-Wno-unused-parameter",
24    "-Wno-unused-result",
25    "-Wno-tautological-overlap-compare",
26  ]
27
28  defines = [
29    "TARGET_FLOSS",
30  ]
31
32  libs = [
33    "ssl",
34    "crypto",
35  ]
36
37  include_dirs = [ "//bt/system/gd" ]
38  configs = [
39    "//bt/system:target_defaults",
40    "//bt/system/log:log_defaults",
41  ]
42}
43
44config("rust_defaults") {
45  # Empty for now
46}
47
48group("gd_default_deps") {
49  deps = [
50    "//bt/system:libbt-platform-protos-lite",
51    "//bt/system/gd:BluetoothGeneratedDumpsysDataSchema_h",
52    "//bt/system/gd/dumpsys:libbluetooth-dumpsys",
53    "//bt/system/gd/rust/shim:init_flags_bridge_header",
54    "//bt/system/pdl:BluetoothGeneratedPackets_h",
55  ]
56}
57
58static_library("libbluetooth_gd") {
59  sources = [
60    "module.cc",
61    "module_dumper.cc",
62    "stack_manager.cc",
63  ]
64
65  include_dirs = [ "." ]
66  configs += [ ":gd_defaults" ]
67  deps = [
68    "//bt/system/gd/rust/topshim:libbluetooth_topshim",
69    "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
70    "//bt/system/gd/common:BluetoothCommonSources",
71    "//bt/system/gd/dumpsys:BluetoothDumpsysSources",
72    "//bt/system/gd/hal:BluetoothHalSources",
73    "//bt/system/gd/hal:BluetoothHalSources_hci_host",
74    "//bt/system/gd/hal:BluetoothHalSources_ranging_host",
75    "//bt/system/gd/l2cap:BluetoothL2capSources",
76    "//bt/system/gd/metrics:BluetoothMetricsSources",
77    "//bt/system/gd/neighbor:BluetoothNeighborSources",
78    "//bt/system/gd/security:BluetoothSecuritySources",
79    "//bt/system/gd/shim:BluetoothShimSources",
80    "//bt/system/gd/storage:BluetoothStorageSources",
81    "//bt/system/gd/sysprops:BluetoothSyspropsSources",
82    "//bt/system/pdl:BluetoothGeneratedPackets_h",
83  ]
84}
85
86flatbuffer("BluetoothGeneratedDumpsysDataSchema_h") {
87  sources = [
88    "common/init_flags.fbs",
89    "dumpsys_data.fbs",
90    "hci/hci_acl_manager.fbs",
91    "hci/hci_controller.fbs",
92    "l2cap/classic/l2cap_classic_module.fbs",
93    "os/wakelock_manager.fbs",
94    "shim/dumpsys.fbs",
95  ]
96}
97
98bt_flatc_binary_schema("BluetoothGeneratedDumpsysBinarySchema_bfbs") {
99  sources = [
100    "common/init_flags.fbs",
101    "dumpsys_data.fbs",
102    "hci/hci_acl_manager.fbs",
103    "hci/hci_controller.fbs",
104    "l2cap/classic/l2cap_classic_module.fbs",
105    "os/wakelock_manager.fbs",
106    "shim/dumpsys.fbs",
107  ]
108
109  include_dir = "system/gd"
110}
111