Skip to content

Commit 947d468

Browse files
committed
floss: Change build rules from //bt to //bt/system
Ran a sed rule to replace most instances of //bt to //bt/system in all BUILD.gn and *.gni files. Also made some manual changes to include directories using packetgen and dumpsys to include bt/system/gd instead of just bt/gd. Added a new BUILD.gn at root that just points to system/BUILD.gn. On the Rust side, updated the Cargo.toml paths and build.rs includes for topshim. Bug: 205591223 Test: Run `./build.py` Tag: #floss Change-Id: Ib6b9b991f140742d765a1031c8f4085aba9ce552
1 parent eb95879 commit 947d468

File tree

48 files changed

+731
-696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+731
-696
lines changed

BUILD.gn

Lines changed: 4 additions & 206 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2015 Google, Inc.
2+
# Copyright 2020 Google, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -21,211 +21,9 @@
2121
# file to your new one or GN won't know about it.
2222

2323
group("all") {
24-
deps = [ ":bluetooth" ]
25-
26-
#if (use.test) {
27-
#deps += [ ":bluetooth_tests" ]
28-
#}
29-
}
30-
31-
# This pulls in main/BUILD.gn and all of its dependencies.
32-
group("bluetooth") {
33-
deps = [
34-
"//bt/main:bluetooth",
35-
"//bt/main:bluetooth-static",
36-
#"//bt/service:bluetoothtbd",
37-
]
38-
}
39-
40-
# TODO(b/190750167) - Re-enable once we're fully Bazel build
41-
#if (use.test) {
42-
#group("bluetooth_tests") {
43-
#deps = [
44-
#"//bt/btcore:net_test_btcore",
45-
#"//bt/common:bluetooth_test_common",
46-
#"//bt/profile/avrcp:net_test_avrcp",
47-
#"//bt/service:bluetoothtbd_test",
48-
#"//bt/stack:net_test_btm_iso",
49-
#"//bt/types:net_test_types",
50-
51-
##"//bt/packet:net_test_btpackets",
52-
#]
53-
#}
54-
#}
55-
56-
if (host_cpu == target_cpu && host_os == target_os) {
57-
group("tools") {
58-
deps = [
59-
"//bt/gd/dumpsys/bundler:bluetooth_flatbuffer_bundler",
60-
"//bt/gd/packet/parser:bluetooth_packetgen",
61-
]
62-
}
24+
deps = [ "//bt/system:all" ]
6325
}
6426

65-
if (defined(use.android) && use.android) {
66-
group("android_bluetooth_tests") {
67-
deps = [
68-
"//bt/device:net_test_device",
69-
"//bt/hci:net_test_hci",
70-
"//bt/osi:net_test_osi",
71-
"//bt/test/suite:net_test_bluetooth",
72-
]
73-
}
74-
}
75-
76-
config("target_defaults") {
77-
include_dirs = [
78-
"//bt",
79-
"//bt/linux_include",
80-
"//bt/types",
81-
"//bt/include",
82-
83-
# For flatbuffer generated headers
84-
"${root_gen_dir}/bt/gd/",
85-
"${root_gen_dir}/bt/gd/dumpsys/bundler",
86-
]
87-
88-
cflags = [
89-
"-fPIC",
90-
"-Wno-non-c-typedef-for-linkage",
91-
"-Wno-unreachable-code-return",
92-
"-Wno-defaulted-function-deleted",
93-
"-Wno-gnu-variable-sized-type-not-at-end",
94-
"-Wno-format-nonliteral",
95-
"-Wno-inconsistent-missing-override",
96-
"-Wno-unreachable-code",
97-
"-Wno-range-loop-construct",
98-
"-Wno-reorder-init-list",
99-
"-Wno-unused-function",
100-
"-Wno-unused-result",
101-
"-Wno-unused-variable",
102-
"-Wno-unused-const-variable",
103-
"-Wno-format",
104-
"-Wno-pessimizing-move",
105-
"-Wno-unknown-warning-option",
106-
"-Wno-final-dtor-non-final-class",
107-
]
108-
109-
cflags_cc = [
110-
"-std=c++17",
111-
]
112-
113-
defines = [
114-
"HAS_NO_BDROID_BUILDCFG",
115-
"OS_GENERIC",
116-
"OS_LINUX_GENERIC",
117-
"TARGET_FLOSS",
118-
"EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
119-
"FALLTHROUGH_INTENDED=[[clang::fallthrough]]",
120-
]
121-
122-
# If not configured as a dynamic library, default to static library
123-
if (!(defined(use.bt_dynlib) && use.bt_dynlib)) {
124-
defines += [
125-
"STATIC_LIBBLUETOOTH",
126-
]
127-
}
128-
129-
if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) {
130-
defines += [ "EXCLUDE_NONSTANDARD_CODECS" ]
131-
}
132-
133-
configs = [ ":external_libchrome" ]
134-
}
135-
136-
group("libbt-platform-protos-lite") {
137-
deps = [
138-
"//external/proto_logging/stats/enums/bluetooth:libbt-platform-protos-lite",
139-
]
140-
}
141-
142-
# Configurations to use as dependencies for GN build
143-
config("external_gtest") {
144-
configs = [
145-
":pkg_gtest",
146-
":pkg_gmock",
147-
]
148-
}
149-
150-
config("external_gtest_main") {
151-
configs = [ ":pkg_gtest_main" ]
152-
}
153-
154-
config("external_gmock_main") {
155-
configs = [ ":pkg_gmock_main" ]
156-
}
157-
158-
config("external_libchrome") {
159-
configs = [ ":pkg_libchrome" ]
160-
}
161-
162-
config("external_modp_b64") {
163-
configs = [ ":pkg_modp_b64" ]
164-
}
165-
166-
config("external_tinyxml2") {
167-
configs = [ ":pkg_tinyxml2" ]
168-
}
169-
170-
config("external_flatbuffers") {
171-
lib_dirs = [ "${libdir}" ]
172-
173-
libs = [ "flatbuffers" ]
174-
}
175-
176-
# Package configurations to extract dependencies from env
177-
pkg_config("pkg_gtest") {
178-
pkg_deps = [ "gtest" ]
179-
}
180-
181-
pkg_config("pkg_gtest_main") {
182-
pkg_deps = [ "gtest_main" ]
183-
}
184-
185-
pkg_config("pkg_gmock") {
186-
pkg_deps = [ "gmock" ]
187-
}
188-
189-
pkg_config("pkg_gmock_main") {
190-
pkg_deps = [ "gmock_main" ]
191-
}
192-
193-
pkg_config("pkg_libchrome") {
194-
pkg_deps = [ "libchrome" ]
195-
}
196-
197-
pkg_config("pkg_modp_b64") {
198-
pkg_deps = [ "libmodp_b64" ]
199-
}
200-
201-
pkg_config("pkg_tinyxml2") {
202-
pkg_deps = [ "tinyxml2" ]
203-
}
204-
205-
# To use non-standard codecs (i.e. ldac, aac, aptx), set this use flag when
206-
# building. These codecs may have licensing issues that need to be resolved
207-
# first.
208-
if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
209-
config("external_aac") {
210-
configs = [ ":pkg_aac" ]
211-
}
212-
213-
pkg_config("pkg_aac") {
214-
pkg_deps = [ "fdk-aac" ]
215-
}
216-
217-
config("external_libldac") {
218-
configs = [
219-
":pkg_libldacBT_enc",
220-
":pkg_libldacBT_abr",
221-
]
222-
}
223-
224-
pkg_config("pkg_libldacBT_enc") {
225-
pkg_deps = [ "ldacBT-enc" ]
226-
}
227-
228-
pkg_config("pkg_libldacBT_abr") {
229-
pkg_deps = [ "ldacBT-abr" ]
230-
}
27+
group("tools") {
28+
deps = [ "//bt/system:tools" ]
23129
}

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
[workspace]
1717

1818
members = [
19-
"gd/rust/shim",
20-
"gd/rust/topshim",
21-
"gd/rust/linux/mgmt",
22-
"gd/rust/linux/service",
23-
"gd/rust/linux/client",
19+
"system/gd/rust/shim",
20+
"system/gd/rust/topshim",
21+
"system/gd/rust/linux/mgmt",
22+
"system/gd/rust/linux/service",
23+
"system/gd/rust/linux/client",
2424
]

0 commit comments

Comments
 (0)