summaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
author Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-03-02 22:33:10 +0000
committer Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-03-04 22:48:19 +0000
commit9bd8242a9be8402028f4b56e472c9f91d7e7e250 (patch)
tree8732ed71dbb7b8f0b32ca9b4357547d3f244215f /BUILD.gn
parentb3fe88bfc3724f08b7a37c9f22ac5cff1dbd70f0 (diff)
Build support and abstractions for Linux build
This has a large number of fixes to build on Linux/ChromeOS. In general, it is making sure the BUILD.gn and Android.bp for a directory structure match and it has all the configs + deps needed to build. Besides a number of simple fixups (missing headers), there are also a few abstractions that need to be noted: * All of audio HAL is stubbed out (using the host implementation) * Parameter provider and system_properties (under gd/os) now have a linux variant that changes where configuration files are kept. The current location for linux is now /etc/systembt. This implementation was copied from the host versions (which seems to be used for host testing). Bug: 176847256 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: I1a6b3b362cedbe5f675794a115a330cc7f85f9c1
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn62
1 files changed, 41 insertions, 21 deletions
diff --git a/BUILD.gn b/BUILD.gn
index bf9b51c3ba..902a9cd9a3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -21,14 +21,10 @@
# file to your new one or GN won't know about it.
group("all") {
- deps = [
- ":bluetooth",
- ]
+ deps = [ ":bluetooth" ]
if (use.test) {
- deps += [
- ":bluetooth_tests"
- ]
+ deps += [ ":bluetooth_tests" ]
}
}
@@ -43,24 +39,34 @@ group("bluetooth") {
if (use.test) {
group("bluetooth_tests") {
deps = [
+ "//bt/btcore:net_test_btcore",
"//bt/common:bluetooth_test_common",
- "//bt/service:bluetoothtbd_test",
"//bt/profile/avrcp:net_test_avrcp",
- "//bt/btcore:net_test_btcore",
- "//bt/types:net_test_types",
+ "//bt/service:bluetoothtbd_test",
"//bt/stack:net_test_btm_iso",
+ "//bt/types:net_test_types",
+
#"//bt/packet:net_test_btpackets",
]
}
}
+if (host_cpu == target_cpu && host_os == target_os) {
+ group("tools") {
+ deps = [
+ "//bt/gd/dumpsys/bundler:bluetooth_flatbuffer_bundler",
+ "//bt/gd/packet/parser:bluetooth_packetgen",
+ ]
+ }
+}
+
if (defined(use.android) && use.android) {
group("android_bluetooth_tests") {
deps = [
- "//bt/test/suite:net_test_bluetooth",
+ "//bt/device:net_test_device",
"//bt/hci:net_test_hci",
"//bt/osi:net_test_osi",
- "//bt/device:net_test_device",
+ "//bt/test/suite:net_test_bluetooth",
]
}
}
@@ -71,11 +77,13 @@ config("target_defaults") {
"//bt/linux_include",
"//bt/types",
"//bt/include",
+
+ # For flatbuffer generated headers
+ "${root_gen_dir}/bt/gd/",
+ "${root_gen_dir}/bt/gd/dumpsys/bundler",
]
cflags = [
- "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
- "-DFALLTHROUGH_INTENDED=[[clang::fallthrough]]",
"-fPIC",
"-Wno-non-c-typedef-for-linkage",
"-Wno-unreachable-code-return",
@@ -91,20 +99,26 @@ config("target_defaults") {
"-Wno-unused-variable",
"-Wno-unused-const-variable",
"-Wno-format",
+ "-Wno-pessimizing-move",
+ "-Wno-unknown-warning-option",
+ "-Wno-final-dtor-non-final-class",
]
- cflags_cc = [
- "-std=c++17",
- ]
+ cflags_cc = [ "-std=c++17" ]
defines = [
"HAS_NO_BDROID_BUILDCFG",
"OS_GENERIC",
+ "OS_LINUX_GENERIC",
+ "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
+ "FALLTHROUGH_INTENDED=[[clang::fallthrough]]",
]
- configs = [
- ":external_libchrome",
- ]
+ if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) {
+ defines += [ "EXCLUDE_NONSTANDARD_CODECS" ]
+ }
+
+ configs = [ ":external_libchrome" ]
}
# Configurations to use as dependencies for GN build
@@ -135,6 +149,12 @@ config("external_tinyxml2") {
configs = [ ":pkg_tinyxml2" ]
}
+config("external_flatbuffers") {
+ lib_dirs = [ "${libdir}" ]
+
+ libs = [ "flatbuffers" ]
+}
+
# Package configurations to extract dependencies from env
pkg_config("pkg_gtest") {
pkg_deps = [ "gtest" ]
@@ -184,10 +204,10 @@ if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
}
pkg_config("pkg_libldacBT_enc") {
- pkg_deps = [ "ldacBT-enc", ]
+ pkg_deps = [ "ldacBT-enc" ]
}
pkg_config("pkg_libldacBT_abr") {
- pkg_deps = [ "ldacBT-abr", ]
+ pkg_deps = [ "ldacBT-abr" ]
}
}