• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/gd/dumpsys/bundler/bundler.gni")
17import("//bt/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    "OS_LINUX_GENERIC",
30    "OS_GENERIC",
31  ]
32
33  libs = [
34    "ssl",
35    "crypto",
36  ]
37
38  include_dirs = [ "//bt/gd" ]
39  configs = [ "//bt:target_defaults" ]
40}
41
42config("rust_defaults") {
43  # Empty for now
44}
45
46group("gd_default_deps") {
47  deps = [
48    "//bt/gd:BluetoothGeneratedDumpsysDataSchema_h",
49    "//bt/gd:BluetoothGeneratedPackets_h",
50    "//bt/gd/dumpsys:BluetoothGeneratedDumpsysBundledSchema_h",
51    "//bt/gd/rust/shim:init_flags_bridge_header",
52  ]
53}
54
55static_library("libbluetooth_gd") {
56  sources = [
57    "module.cc",
58    "stack_manager.cc",
59  ]
60
61  include_dirs = [ "." ]
62  configs += [ ":gd_defaults" ]
63  deps = [
64    "//bt/gd/rust/topshim:libbluetooth_topshim",
65    "//bt/gd/rust/shim:libbluetooth_rust_interop",
66    "//bt/gd:BluetoothGeneratedPackets_h",
67    "//bt/gd/att:BluetoothAttSources",
68    "//bt/gd/common:BluetoothCommonSources",
69    "//bt/gd/crypto_toolbox:BluetoothCryptoToolboxSources",
70    "//bt/gd/dumpsys:BluetoothDumpsysSources",
71    "//bt/gd/btaa:BluetoothBtaaSources_linux",
72    "//bt/gd/hal:BluetoothHalSources",
73    "//bt/gd/hal:BluetoothHalSources_hci_host",
74    "//bt/gd/l2cap:BluetoothL2capSources",
75    "//bt/gd/neighbor:BluetoothNeighborSources",
76    "//bt/gd/security:BluetoothSecuritySources",
77    "//bt/gd/shim:BluetoothShimSources",
78    "//bt/gd/storage:BluetoothStorageSources",
79  ]
80}
81
82flatbuffer("BluetoothGeneratedDumpsysDataSchema_h") {
83  sources = [
84    "btaa/activity_attribution.fbs",
85    "common/init_flags.fbs",
86    "dumpsys_data.fbs",
87    "hci/hci_acl_manager.fbs",
88    "l2cap/classic/l2cap_classic_module.fbs",
89    "shim/dumpsys.fbs",
90  ]
91}
92
93bt_flatc_binary_schema("BluetoothGeneratedDumpsysBinarySchema_bfbs") {
94  sources = [
95    "btaa/activity_attribution.fbs",
96    "common/init_flags.fbs",
97    "dumpsys_data.fbs",
98    "hci/hci_acl_manager.fbs",
99    "l2cap/classic/l2cap_classic_module.fbs",
100    "shim/dumpsys.fbs",
101  ]
102
103  include_dir = "bt/gd"
104}
105
106packetgen_py("BluetoothGeneratedPackets_python3_cc") {
107  sources = [
108    "hci/hci_packets.pdl",
109    "l2cap/l2cap_packets.pdl",
110    "security/smp_packets.pdl",
111  ]
112
113  include = "bt/gd"
114  source_root = "../.."
115  shards = 10
116}
117
118packetgen_headers("BluetoothGeneratedPackets_h") {
119  sources = [
120    "hci/hci_packets.pdl",
121    "l2cap/l2cap_packets.pdl",
122    "security/smp_packets.pdl",
123  ]
124
125  include = "bt/gd"
126  source_root = "../.."
127}
128
129packetgen_rust("BluetoothGeneratedPackets_rust") {
130  sources = [ "hci/hci_packets.pdl" ]
131
132  include = "bt/gd"
133  source_root = "../.."
134}
135