diff --git a/BUILD.gn b/BUILD.gn index 456fbeb8fe21f1371bf33ca70a940d2dd90264e9..a477b2a068c03460e19eca235be55f4c65d7e284 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -20,11 +20,17 @@ # you add a new build file, there must be some path of dependencies from this # file to your new one or GN won't know about it. +group("all") { + deps = [ + ":bluetooth", + ] +} + # This pulls in main/BUILD.gn and all of its dependencies. group("bluetooth") { deps = [ - "//main:bluetooth", - "//service:bluetoothtbd", + "//bt/main:bluetooth", + "//bt/service:bluetoothtbd", ] } @@ -32,10 +38,131 @@ group("bluetooth_tests") { testonly = true deps = [ - "//test/suite:net_test_bluetooth", - "//btcore:net_test_btcore", - "//hci:net_test_hci", - "//osi:net_test_osi", - "//device:net_test_device", + "//bt/test/suite:net_test_bluetooth", + "//bt/btcore:net_test_btcore", + "//bt/hci:net_test_hci", + "//bt/osi:net_test_osi", + "//bt/device:net_test_device", + ] +} + +config("target_defaults") { + include_dirs = [ + "//bt/linux_include", + "//bt/types", + "//bt/include", + ] + + cflags = [ + "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", + "-DFALLTHROUGH_INTENDED=[[clang::fallthrough]]", + "-fPIC", + "-Wno-non-c-typedef-for-linkage", + "-Wno-unreachable-code-return", + "-Wno-defaulted-function-deleted", + "-Wno-gnu-variable-sized-type-not-at-end", + "-Wno-format-nonliteral", + "-Wno-inconsistent-missing-override", + "-Wno-unreachable-code", + "-Wno-range-loop-construct", + "-Wno-reorder-init-list", + "-Wno-unused-function", + "-Wno-unused-result", + "-Wno-unused-variable", + "-Wno-unused-const-variable", + ] + + cflags_cc = [ + "-std=c++17", + ] + + defines = [ + "HAS_NO_BDROID_BUILDCFG", + "OS_GENERIC", + ] + + configs = [ + ":external_libchrome", + ] +} + +# Configurations to use as dependencies for GN build +config("external_gtest") { + configs = [ + ":pkg_gtest", + ":pkg_gmock", ] } + +config("external_gtest_main") { + configs = [ ":pkg_gtest_main" ] +} + +config("external_gmock_main") { + configs = [ ":pkg_gmock_main" ] +} + +config("external_libchrome") { + configs = [ ":pkg_libchrome" ] +} + +config("external_modp_b64") { + configs = [ ":pkg_modp_b64" ] +} + +config("external_tinyxml2") { + configs = [ ":pkg_tinyxml2" ] +} + +# Package configurations to extract dependencies from env +pkg_config("pkg_gtest") { + pkg_deps = [ "gtest" ] +} + +pkg_config("pkg_gtest_main") { + pkg_deps = [ "gtest_main" ] +} + +pkg_config("pkg_gmock") { + pkg_deps = [ "gmock" ] +} + +pkg_config("pkg_gmock_main") { + pkg_deps = [ "gmock_main" ] +} + +pkg_config("pkg_libchrome") { + pkg_deps = [ "libchrome" ] +} + +pkg_config("pkg_modp_b64") { + pkg_deps = [ "libmodp_b64" ] +} + +pkg_config("pkg_tinyxml2") { + pkg_deps = [ "tinyxml2" ] +} + +# Uncomment if building nonstandard codecs +# config("external_aac") { +# configs = [ ":pkg_aac" ] +# } +# +# pkg_config("pkg_aac") { +# pkg_deps = [ "fdk-aac" ] +# } +# +# config("external_libldac") { +# configs = [ +# ":pkg_libldacBT_enc", +# ":pkg_libldacBT_abr", +# ] +# } +# +# pkg_config("pkg_libldacBT_enc") { +# pkg_deps = [ "ldacBT-enc", ] +# } +# +# pkg_config("pkg_libldacBT_abr") { +# pkg_deps = [ "ldacBT-abr", ] +# } diff --git a/system/bta/BUILD.gn b/system/bta/BUILD.gn index 6632c24d7a4dc50d3109dd321aea3f75f6371338..da4fe80b6e9ab7ada89e90acd7536a7395fe04ae 100644 --- a/system/bta/BUILD.gn +++ b/system/bta/BUILD.gn @@ -92,28 +92,32 @@ static_library("bta") { "hd", "include", "sys", - "//", - "//linux_include", - "//bta", - "//internal_include", - "//btcore/include", - "//hci/include", - "//internal_include", - "//stack/include", - "//stack/btm", - "//udrv/include", - "//utils/include", - "//vnd/include", - "//btif/include", - "//btif/avrcp", - "//include/hardware/avrcp", - "//profile/avrcp", - "//packet/avrcp", - "//packet/base", + "//bt/", + "//bt/linux_include", + "//bt/bta", + "//bt/internal_include", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/include", + "//bt/stack/btm", + "//bt/udrv/include", + "//bt/utils/include", + "//bt/vnd/include", + "//bt/btif/include", + "//bt/btif/avrcp", + "//bt/include/hardware/avrcp", + "//bt/profile/avrcp", + "//bt/packet/avrcp", + "//bt/packet/base", + ] + + configs += [ + "//bt:target_defaults" ] deps = [ - "//third_party/libchrome:base" + "//bt/gd/rust/shim:init_flags_bridge_header", ] } @@ -128,18 +132,21 @@ executable("net_test_bta") { include_dirs = [ "include", - "//", - "//bta", - "//btcore/include", - "//hci/include", - "//internal_include", - "//stack/btm", + "//bt/", + "//bt/bta", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/btm", ] deps = [ - "//bta", - "//types", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/bta", + "//bt/types", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:target_defaults", ] } diff --git a/system/btcore/BUILD.gn b/system/btcore/BUILD.gn index 01b9cf7e3373da789c306518ffd801dca972117a..3aef8f6a78bd1491abc6e87f79ae885f6e672311 100644 --- a/system/btcore/BUILD.gn +++ b/system/btcore/BUILD.gn @@ -25,11 +25,15 @@ static_library("btcore") { include_dirs = [ "include", - "//", + "//bt", + ] + + configs += [ + "//bt:target_defaults", ] deps = [ - "//third_party/libchrome:base", + "//bt/gd/rust/shim:init_flags_bridge_header", ] } @@ -38,20 +42,23 @@ executable("net_test_btcore") { sources = [ "test/device_class_test.cc", "test/property_test.cc", - "//osi/test/AllocationTestHarness.cc", + "//bt/osi/test/AllocationTestHarness.cc", ] include_dirs = [ "include", - "//", + "//bt", ] deps = [ - "//btcore", - "//osi", - "//types", - "//third_party/googletest:gtest_main", - "//third_party/libchrome:base", + "//bt/btcore", + "//bt/osi", + "//bt/types", + ] + + configs += [ + "//bt:external_gtest_main", + "//bt:target_defaults", ] libs = [ diff --git a/system/btif/BUILD.gn b/system/btif/BUILD.gn index 0efd55a611202aa74a08dab34c6084d0c517661e..b6c4ad89951293a420a26d25f3111b17dd2be6d7 100644 --- a/system/btif/BUILD.gn +++ b/system/btif/BUILD.gn @@ -16,13 +16,13 @@ static_library("btif") { sources = [ - "//audio_a2dp_hw/src/audio_a2dp_hw_utils.cc", - "//audio_hearing_aid_hw/src/audio_hearing_aid_hw_utils.cc", + "//bt/audio_a2dp_hw/src/audio_a2dp_hw_utils.cc", + "//bt/audio_hearing_aid_hw/src/audio_hearing_aid_hw_utils.cc", "src/btif_a2dp.cc", "src/btif_a2dp_audio_interface_linux.cc", "src/btif_a2dp_control.cc", "src/btif_a2dp_sink.cc", - "src/btif_a2dp_source.cc", + # "src/btif_a2dp_source.cc", "src/btif_av.cc", "avrcp/avrcp_service.cc", @@ -31,7 +31,7 @@ static_library("btif") { "src/btif_avrcp_audio_track_linux.cc", "src/btif_ble_advertiser.cc", "src/btif_ble_scanner.cc", - "src/btif_config.cc", + # "src/btif_config.cc", "src/btif_config_transcode.cc", "src/btif_core.cc", "src/btif_debug.cc", @@ -77,32 +77,38 @@ static_library("btif") { include_dirs = [ "include", - "//", - "//linux_include", - "//audio_a2dp_hw/include", - "//audio_hearing_aid_hw/include", - "//bta/include", - "//bta/sys", - "//btcore/include", - "//device/include", - "//embdrv/sbc/encoder/include", - "//embdrv/sbc/decoder/include", - "//hci/include", - "//stack/a2dp", - "//stack/btm", - "//stack/l2cap", - "//stack/include", - "//third_party/tinyxml2", - "//internal_include", - "//udrv/include", - "//utils/include", - "//vnd/include", - "//profile/avrcp", + "//bt/", + "//bt/bta/dm", + "//bt/linux_include", + "//bt/audio_a2dp_hw/include", + "//bt/audio_hearing_aid_hw/include", + "//bt/bta/include", + "//bt/bta/sys", + "//bt/btcore/include", + "//bt/device/include", + "//bt/embdrv/sbc/encoder/include", + "//bt/embdrv/sbc/decoder/include", + "//bt/hci/include", + "//bt/stack/a2dp", + "//bt/stack/btm", + "//bt/stack/l2cap", + "//bt/stack/include", + "//bt/internal_include", + "//bt/udrv/include", + "//bt/utils/include", + "//bt/vnd/include", + "//bt/profile/avrcp", ] deps = [ - "//common", - "//third_party/libchrome:base", - "//profile/avrcp:profile_avrcp" + "//bt/common", + "//bt/gd/rust/shim:init_flags_bridge_header", + "//bt/profile/avrcp:profile_avrcp", + "//bt/third_party/proto_logging/stats:libbt-platform-protos", + ] + + configs += [ + "//bt:target_defaults", + "//bt:external_tinyxml2", ] } diff --git a/system/btif/avrcp/avrcp_service.h b/system/btif/avrcp/avrcp_service.h index b60700f33e898cbab4d4535e73355507f814dea0..067631ecd646826648b35336d026deb7ee56062d 100644 --- a/system/btif/avrcp/avrcp_service.h +++ b/system/btif/avrcp/avrcp_service.h @@ -18,6 +18,7 @@ #include <map> #include <memory> +#include <mutex> #include "hardware/avrcp/avrcp.h" #include "osi/include/properties.h" diff --git a/system/common/BUILD.gn b/system/common/BUILD.gn index 76d70f8fbfb112b0b9cb0668a65a846b8b167d9b..f491cde323c0b818723445104b3bf92439ffc5e1 100644 --- a/system/common/BUILD.gn +++ b/system/common/BUILD.gn @@ -19,18 +19,22 @@ static_library("common") { "message_loop_thread.cc", "metrics_linux.cc", "time_util.cc", - "timer.cc", ] include_dirs = [ - "//", - "//stack/include", - "//linux_include", - "//internal_include", + "//bt/", + "//bt/stack/include", + "//bt/linux_include", + "//bt/internal_include", ] deps = [ - "//third_party/libchrome:base", + "//bt/gd/rust/shim:init_flags_bridge_header", + "//bt/third_party/proto_logging/stats:libbt-platform-protos", + ] + + configs += [ + "//bt:target_defaults", ] } @@ -40,19 +44,21 @@ executable("bt_test_common") { "leaky_bonded_queue_unittest.cc", "state_machine_unittest.cc", "time_util_unittest.cc", - "timer_unittest.cc" ] include_dirs = [ - "//", - "//common", + "//bt/", + "//bt/common", ] deps = [ - "//common", - "//third_party/googletest:gtest_main", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/common", + ] + + configs += [ + "//bt:external_gtest_main", + "//bt:external_gmock_main", + "//bt:target_defaults", ] libs = [ diff --git a/system/device/BUILD.gn b/system/device/BUILD.gn index 5de439d306944a8cf4f03f4017995ca8c6c07bb4..cf016dc4e3b4410ad379764b699c54ea1966c182 100644 --- a/system/device/BUILD.gn +++ b/system/device/BUILD.gn @@ -22,32 +22,39 @@ static_library("device") { ] include_dirs = [ - "//", - "//btcore/include", - "//hci/include", - "//internal_include", - "//stack/include", + "//bt/", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/include", + ] + + configs += [ + "//bt:target_defaults", ] deps = [ - "//third_party/libchrome:base", + "//bt/gd/rust/shim:init_flags_bridge_header", ] } executable("net_test_device") { testonly = true sources = [ - "//osi/test/AllocationTestHarness.cc", + "//bt/osi/test/AllocationTestHarness.cc", ] - include_dirs = [ "//" ] + include_dirs = [ "//bt" ] deps = [ - "//device", - "//btcore", - "//osi", - "//third_party/googletest:gtest_main", - "//third_party/libchrome:base", + "//bt/device", + "//bt/btcore", + "//bt/osi", + ] + + configs += [ + "//bt:external_gtest_main", + "//bt:target_defaults", ] libs = [ diff --git a/system/embdrv/sbc/BUILD.gn b/system/embdrv/sbc/BUILD.gn index 696080a07b9070e22d68e0b4a96a60af261865f4..ce85245823e3473de45eed169363daf01fa794cf 100644 --- a/system/embdrv/sbc/BUILD.gn +++ b/system/embdrv/sbc/BUILD.gn @@ -33,6 +33,8 @@ source_set("sbc_decoder") { ] include_dirs = [ "decoder/include" ] + + configs += [ "//bt:target_defaults" ] } source_set("sbc_encoder") { @@ -49,9 +51,11 @@ source_set("sbc_encoder") { include_dirs = [ "encoder/include", - "//internal_include", - "//stack/include", + "//bt/internal_include", + "//bt/stack/include", ] + + configs += [ "//bt:target_defaults" ] } static_library("sbc") { diff --git a/system/gd/proto/BUILD.gn b/system/gd/proto/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ba5cd4eaaf5270abb37bec3730adc2e51fcec908 --- /dev/null +++ b/system/gd/proto/BUILD.gn @@ -0,0 +1,10 @@ +import("//common-mk/proto_library.gni") + +proto_library("libbt-protos-lite") { + sources = [ + "bluetooth/metrics/bluetooth.proto", + ] + + proto_in_dir = "./bluetooth/metrics" + proto_out_dir = "include/bluetooth/metrics" +} diff --git a/.gn b/system/gd/rust/shim/BUILD.gn similarity index 63% rename from .gn rename to system/gd/rust/shim/BUILD.gn index 1c2396dfc70c7539475da375d9432d6b4779ac12..8843c934ad43d49f5e80ab707337f682271812a1 100644 --- a/.gn +++ b/system/gd/rust/shim/BUILD.gn @@ -1,5 +1,5 @@ # -# Copyright 2015 Google, Inc. +# Copyright 2020 Google # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,9 +14,16 @@ # limitations under the License. # -# This file is used by the GN meta build system to find the root of the source -# tree and to set startup options. For documentation on the values set in this -# file, run "gn help dotfile" at the command line. +import("//common-mk/cxxbridge.gni") -buildconfig = "//build/config/BUILDCONFIG.gn" -secondary_source = "//build/secondary/" +cxxbridge_header("shim_bridge_header") { + sources = [ "src/stack.rs" ] +} + +cxxbridge_header("init_flags_bridge_header") { + sources = [ "src/init_flags.rs" ] +} + +cxxbridge_header("hci_bridge_header") { + sources = [ "src/hci.rs" ] +} diff --git a/system/hci/BUILD.gn b/system/hci/BUILD.gn index e29e2569ed5aa502c9cb1ca7158e3fb9150428c7..28f8fe2a2c109a38d70d7fec1d2e45019b8b6544 100644 --- a/system/hci/BUILD.gn +++ b/system/hci/BUILD.gn @@ -30,42 +30,48 @@ static_library("hci") { include_dirs = [ "include", - "//", - "//internal_include", - "//bta/include", - "//btcore/include", - "//stack/include", + "//bt/", + "//bt/internal_include", + "//bt/bta/include", + "//bt/btcore/include", + "//bt/stack/include", ] deps = [ - "//common", - "//third_party/libchrome:base", + "//bt/common", + ] + + configs += [ + "//bt:target_defaults", ] } executable("net_test_hci") { testonly = true sources = [ - "//osi/test/AllocationTestHarness.cc", - "//osi/test/AlarmTestHarness.cc", + "//bt/osi/test/AllocationTestHarness.cc", + "//bt/osi/test/AlarmTestHarness.cc", "test/packet_fragmenter_test.cc", ] include_dirs = [ - "//", - "//internal_include", - "//btcore/include", - "//hci/include", - "//osi/test", - "//stack/include", + "//bt/", + "//bt/internal_include", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/osi/test", + "//bt/stack/include", ] deps = [ - "//hci", - "//osi", - "//btcore", - "//third_party/googletest:gtest_main", - "//third_party/libchrome:base", + "//bt/hci", + "//bt/osi", + "//bt/btcore", + ] + + configs += [ + "//bt:target_defaults", + "//bt:external_gtest_main", ] libs = [ diff --git a/system/include/array_utils.h b/system/include/array_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..d669d0aba082de4d54b8deb104327c86ce723097 --- /dev/null +++ b/system/include/array_utils.h @@ -0,0 +1,20 @@ +// +// Copyright 2021 Google, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#pragma once + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) +#endif diff --git a/system/include/hardware/ble_scanner.h b/system/include/hardware/ble_scanner.h index 1588085e87b529ebb283445a9df2afcfe23ef20b..302a123435dd3e638cea3599676b73aa77d89b48 100644 --- a/system/include/hardware/ble_scanner.h +++ b/system/include/hardware/ble_scanner.h @@ -19,6 +19,7 @@ #include <bluetooth/uuid.h> #include <stdint.h> +#include <memory> #include <vector> #include "bt_common_types.h" #include "bt_gatt_client.h" @@ -156,4 +157,4 @@ class BleScannerInterface { virtual void RegisterCallbacks(ScanningCallbacks* callbacks) = 0; }; -#endif /* ANDROID_INCLUDE_BLE_SCANNER_H */ \ No newline at end of file +#endif /* ANDROID_INCLUDE_BLE_SCANNER_H */ diff --git a/system/main/BUILD.gn b/system/main/BUILD.gn index c340cd7b7ca480c2a995ce588e519818b8e1afcb..77950ea4dbd8174e13040bc9667da951706cac86 100644 --- a/system/main/BUILD.gn +++ b/system/main/BUILD.gn @@ -24,7 +24,7 @@ shared_library("bluetooth") { # HAL layer sources = [ - "//btif/src/bluetooth.cc", + "//bt/btif/src/bluetooth.cc", ] # platform specific @@ -39,58 +39,61 @@ shared_library("bluetooth") { public_configs = [ ":libbluetooth_config" ] include_dirs = [ - "//", - "//bta/include", - "//bta/sys", - "//bta/dm", - "//btcore/include", - "//internal_include", - "//stack/include", - "//stack/l2cap", - "//stack/a2dp", - "//stack/btm", - "//stack/avdt", - "//hci", - "//hci/include", - "//udrv/include", - "//btif/include", - "//btif/co", - "//hci/includ", - "//vnd/include", - "//brcm/include", - "//embdrv/sbc/encoder/include", - "//embdrv/sbc/decoder/include", - "//utils/include", - "//test/suite", + "//bt/", + "//bt/bta/include", + "//bt/bta/sys", + "//bt/bta/dm", + "//bt/btcore/include", + "//bt/internal_include", + "//bt/stack/include", + "//bt/stack/l2cap", + "//bt/stack/a2dp", + "//bt/stack/btm", + "//bt/stack/avdt", + "//bt/hci", + "//bt/hci/include", + "//bt/udrv/include", + "//bt/btif/include", + "//bt/btif/co", + "//bt/hci/includ", + "//bt/vnd/include", + "//bt/brcm/include", + "//bt/embdrv/sbc/encoder/include", + "//bt/embdrv/sbc/decoder/include", + "//bt/utils/include", + "//bt/test/suite", ] deps = [ - "//bta", - "//btcore", - "//btif", - "//device", - "//embdrv/g722", - "//embdrv/sbc", - "//hci", - "//osi", - "//packet", - "//stack", - "//third_party/libchrome:base", - "//third_party/tinyxml2", - "//udrv", - "//utils", + "//bt/bta", + "//bt/btcore", + "//bt/btif", + "//bt/device", + "//bt/embdrv/g722", + "//bt/embdrv/sbc", + "//bt/hci", + "//bt/osi", + "//bt/packet", + "//bt/stack", + "//bt/udrv", + "//bt/utils", + ] + + configs += [ + "//bt:target_defaults", + "//bt:external_tinyxml2", ] cflags_c = [ "-Lobj/osi", "-losi", ] + libs = [ - "-ldl", - "-lpthread", - "-lresolv", - "-lrt", - "-lz", - "-latomic", + "dl", + "pthread", + "resolv", + "rt", + "z", ] } diff --git a/system/osi/BUILD.gn b/system/osi/BUILD.gn index c4fb0cb10fc43dae3406685cc33312b4cf99a9a7..dc5399c556a27f15f67fcb1a5971b8c8b60992e8 100644 --- a/system/osi/BUILD.gn +++ b/system/osi/BUILD.gn @@ -44,16 +44,20 @@ static_library("osi") { ] include_dirs = [ - "//", - "//linux_include", - "//internal_include", - "//utils/include", - "//stack/include", + "//bt/", + "//bt/linux_include", + "//bt/internal_include", + "//bt/utils/include", + "//bt/stack/include", ] deps = [ - "//common", - "//third_party/libchrome:base", + "//bt/common", + "//bt/gd/rust/shim:init_flags_bridge_header", + ] + + configs += [ + "//bt:target_defaults", ] } @@ -78,15 +82,18 @@ executable("net_test_osi") { ] include_dirs = [ - "//", - "//osi/test", + "//bt/", + "//bt/osi/test", ] deps = [ - "//osi", - "//third_party/googletest:gtest_main", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/osi", + ] + + configs += [ + "//bt:external_gtest_main", + "//bt:external_gmock_main", + "//bt:target_defaults", ] libs = [ diff --git a/system/packet/BUILD.gn b/system/packet/BUILD.gn index 37d6ca49446ecd37810b40c890c2cb2d2e58b321..8b786ccc579a2cf715a8725aeae4b5519fe74480 100644 --- a/system/packet/BUILD.gn +++ b/system/packet/BUILD.gn @@ -40,13 +40,14 @@ static_library("packet") { ] include_dirs = [ - "//", - "//internal_include", - "//stack/include", - "//profile/avrcp", + "//bt/", + "//bt/include", + "//bt/internal_include", + "//bt/stack/include", + "//bt/profile/avrcp", ] - deps = [ - "//third_party/libchrome:base" + configs += [ + "//bt:target_defaults" ] } diff --git a/system/packet/base/packet.h b/system/packet/base/packet.h index 8c8f229620d5c1b70c7befccecf79a188c46dfc9..2de22abac21f6ad5dbcd03cda6850b2c6a8bf7b7 100644 --- a/system/packet/base/packet.h +++ b/system/packet/base/packet.h @@ -17,6 +17,7 @@ #pragma once #include <cstdint> +#include <memory> #include <type_traits> #include <utility> #include <vector> @@ -96,4 +97,4 @@ class Packet : public std::enable_shared_from_this<Packet> { virtual std::pair<size_t, size_t> GetPayloadIndecies() const = 0; }; -} // namespace bluetooth \ No newline at end of file +} // namespace bluetooth diff --git a/system/profile/avrcp/BUILD.gn b/system/profile/avrcp/BUILD.gn index c37e0a7aa357f82e8615c56860f7203d38757408..1778b98334fa57b8f53a248a8312470ac4c2a8d1 100644 --- a/system/profile/avrcp/BUILD.gn +++ b/system/profile/avrcp/BUILD.gn @@ -21,14 +21,14 @@ static_library("profile_avrcp") { ] include_dirs = [ - "//", - "//btcore/include", - "//internal_include", - "//stack/include", - "//profile/avrcp", + "//bt/", + "//bt/btcore/include", + "//bt/internal_include", + "//bt/stack/include", + "//bt/profile/avrcp", ] - deps = [ - "//third_party/libchrome:base" + configs += [ + "//bt:target_defaults" ] } diff --git a/system/service/BUILD.gn b/system/service/BUILD.gn index 59acb167cd308ef0071834c42a24f87b41d23237..f84610623be60ba54bfc5bf3cbd0a7b9f44430ff 100644 --- a/system/service/BUILD.gn +++ b/system/service/BUILD.gn @@ -60,17 +60,20 @@ source_set("service") { ] include_dirs = [ - "//", - "//linux_include", - "//include", - "//service/common", - "//third_party/modp_b64/modp64", + "//bt/", + "//bt/linux_include", + "//bt/include", + "//bt/service/common", ] deps = [ - "//types", - "//osi", - "//third_party/libchrome:base", + "//bt/types", + "//bt/osi", + "//bt/gd/rust/shim:init_flags_bridge_header", + ] + + configs += [ + "//bt:target_defaults", ] } @@ -81,17 +84,19 @@ executable("bluetoothtbd") { deps = [ ":service", - "//btcore", - "//third_party/libchrome:base", - "//third_party/modp_b64", + "//bt/btcore", + ] + + configs += [ + "//bt:target_defaults", ] - include_dirs = [ "//" ] + include_dirs = [ "//bt/" ] libs = [ - "-ldl", - "-lpthread", - "-lrt", + "dl", + "pthread", + "rt", ] } @@ -102,12 +107,14 @@ executable("service_unittests") { "test/settings_unittest.cc", ] - include_dirs = [ "//" ] + include_dirs = [ "//bt/" ] deps = [ ":service", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", - "//third_party/modp_b64", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:target_defaults", ] } diff --git a/system/service/avrcp_target.cc b/system/service/avrcp_target.cc index fb63fba38d338ce97d30d05b8cd2eb5217925ba0..264945a5159efc72582f68ff96c2fe6e18c580ae 100644 --- a/system/service/avrcp_target.cc +++ b/system/service/avrcp_target.cc @@ -26,6 +26,7 @@ #include "base/memory/ptr_util.h" #include "service/logging_helpers.h" +#include "array_utils.h" #include "stack/include/avrc_defs.h" #define PARSE_ADDR(str) \ @@ -157,7 +158,7 @@ bool AvrcpTarget::GetPlayerAppValueResponse( const std::string& str_addr, const std::vector<AvrcpIntValue>& values) { RawAddress addr = PARSE_ADDR(str_addr); btrc_player_settings_t btrc_values; - if (values.size() >= arraysize(btrc_values.attr_ids)) { + if (values.size() >= ARRAY_SIZE(btrc_values.attr_ids)) { LOG(ERROR) << "Too many attribute values"; return false; } diff --git a/system/service/ipc/dbus/bluetooth_adapter.cc b/system/service/ipc/dbus/bluetooth_adapter.cc index fd6688a94af7b3e52056dbe804452f36dec5cbfd..70ee19f188653cecb0c22536c85df2eb10703464 100644 --- a/system/service/ipc/dbus/bluetooth_adapter.cc +++ b/system/service/ipc/dbus/bluetooth_adapter.cc @@ -72,7 +72,7 @@ BluetoothAdapter::BluetoothAdapter(scoped_refptr<Bus> bus, void BluetoothAdapter::Enable(MethodCall* method_call, ExportedObject::ResponseSender response_sender) { VLOG(1) << __func__; - adapter_->Enable(false); + adapter_->Enable(); response_sender.Run(Response::FromMethodCall(method_call)); } diff --git a/system/service/test/ipc_linux_unittest.cc b/system/service/test/ipc_linux_unittest.cc index 4a347ae36cb4d384e9fd13af7560de8f07f2f2ae..762eb88649d2a778a1b4954c4bf90448188132b9 100644 --- a/system/service/test/ipc_linux_unittest.cc +++ b/system/service/test/ipc_linux_unittest.cc @@ -27,6 +27,7 @@ #include <base/strings/stringprintf.h> #include <gtest/gtest.h> +#include "array_utils.h" #include "service/adapter.h" #include "service/hal/fake_bluetooth_gatt_interface.h" #include "service/hal/fake_bluetooth_interface.h" @@ -82,7 +83,7 @@ class IPCLinuxTest : public ::testing::Test { const base::CommandLine::CharType* argv[] = { "program", ipc_socket_arg.c_str(), }; - base::CommandLine::Init(arraysize(argv), argv); + base::CommandLine::Init(ARRAY_SIZE(argv), argv); } void ConnectToTestSocket() { @@ -119,7 +120,7 @@ class IPCLinuxTestDisabled : public IPCLinuxTest { void SetUpCommandLine() override { // Set up with no --ipc-socket-path const base::CommandLine::CharType* argv[] = {"program"}; - base::CommandLine::Init(arraysize(argv), argv); + base::CommandLine::Init(ARRAY_SIZE(argv), argv); } private: diff --git a/system/service/test/settings_unittest.cc b/system/service/test/settings_unittest.cc index 551c1e053d0c3085582ed94a2db8108999bb0d56..60d372e375c257e09d0c0bb8caded5d77e6daf72 100644 --- a/system/service/test/settings_unittest.cc +++ b/system/service/test/settings_unittest.cc @@ -19,6 +19,7 @@ #include <base/macros.h> #include <gtest/gtest.h> +#include "array_utils.h" #include "service/settings.h" #include "service/switches.h" @@ -45,33 +46,33 @@ class SettingsTest : public ::testing::Test { TEST_F(SettingsTest, EmptyCommandLine) { const base::CommandLine::CharType* argv[] = {"program"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_TRUE(settings_.Init()); } TEST_F(SettingsTest, UnexpectedSwitches1) { const base::CommandLine::CharType* argv[] = { "program", "--create-ipc-socket=foobar", "--foobarbaz"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_FALSE(settings_.Init()); } TEST_F(SettingsTest, UnexpectedSwitches2) { const base::CommandLine::CharType* argv[] = {"program", "--foobarbaz"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_FALSE(settings_.Init()); } TEST_F(SettingsTest, UnexpectedArguments1) { const base::CommandLine::CharType* argv[] = {"program", "foobarbaz"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_FALSE(settings_.Init()); } TEST_F(SettingsTest, UnexpectedArguments2) { const base::CommandLine::CharType* argv[] = { "program", "--create-ipc-socket=foobar", "foobarbaz"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_FALSE(settings_.Init()); } @@ -79,21 +80,21 @@ TEST_F(SettingsTest, TooManyIpcOptions) { const base::CommandLine::CharType* argv[] = { "program", "--create-ipc-socket=foobar", "--android-ipc-socket-suffix=foobar"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_FALSE(settings_.Init()); } TEST_F(SettingsTest, GoodArgumentsCreateIpc) { const base::CommandLine::CharType* argv[] = {"program", "--create-ipc-socket=foobar"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_TRUE(settings_.Init()); } TEST_F(SettingsTest, GoodArgumentsAndroidIpc) { const base::CommandLine::CharType* argv[] = { "program", "--android-ipc-socket-suffix=foobar"}; - EXPECT_TRUE(base::CommandLine::Init(arraysize(argv), argv)); + EXPECT_TRUE(base::CommandLine::Init(ARRAY_SIZE(argv), argv)); EXPECT_TRUE(settings_.Init()); } diff --git a/system/stack/BUILD.gn b/system/stack/BUILD.gn index 9bb356ce6e652a3aec1101b181fd933ff2cb39c0..8237d69a223a797385a32e053bc91c6e8c3e382c 100644 --- a/system/stack/BUILD.gn +++ b/system/stack/BUILD.gn @@ -22,26 +22,19 @@ static_library("crypto_toolbox") { ] include_dirs = [ - "//", + "//bt/", ] - deps = [ - "//third_party/libchrome:base", + configs += [ + "//bt:target_defaults", ] } -static_library("stack") { +source_set("nonstandard_codecs") { sources = [ "a2dp/a2dp_aac.cc", "a2dp/a2dp_aac_decoder.cc", "a2dp/a2dp_aac_encoder.cc", - "a2dp/a2dp_api.cc", - "a2dp/a2dp_codec_config.cc", - "a2dp/a2dp_sbc.cc", - "a2dp/a2dp_sbc_decoder.cc", - "a2dp/a2dp_sbc_encoder.cc", - "a2dp/a2dp_sbc_up_sample.cc", - "a2dp/a2dp_vendor.cc", "a2dp/a2dp_vendor_aptx.cc", "a2dp/a2dp_vendor_aptx_encoder.cc", "a2dp/a2dp_vendor_aptx_hd.cc", @@ -50,6 +43,25 @@ static_library("stack") { "a2dp/a2dp_vendor_ldac_abr.cc", "a2dp/a2dp_vendor_ldac_decoder.cc", "a2dp/a2dp_vendor_ldac_encoder.cc", + ] + + configs += [ + # "//bt:external_libldac", + # "//bt:external_aac", + ] +} + +static_library("stack") { + sources = [ + "a2dp/a2dp_api.cc", + "a2dp/a2dp_codec_config.cc", + "a2dp/a2dp_sbc.cc", + "a2dp/a2dp_sbc_decoder.cc", + "a2dp/a2dp_sbc_encoder.cc", + "a2dp/a2dp_sbc_up_sample.cc", + "a2dp/a2dp_vendor.cc", + "acl/btm_acl.cc", + "acl/btm_pm.cc", "avct/avct_api.cc", "avct/avct_bcb_act.cc", "avct/avct_ccb.cc", @@ -64,7 +76,8 @@ static_library("stack") { "avdt/avdt_l2c.cc", "avdt/avdt_msg.cc", "avdt/avdt_scb.cc", - "avdt/avdt_scb_act.cc", + # Disable temporarily due to libcutils dependency + #"avdt/avdt_scb_act.cc", "avrc/avrc_api.cc", "avrc/avrc_bld_ct.cc", "avrc/avrc_bld_tg.cc", @@ -78,7 +91,6 @@ static_library("stack") { "bnep/bnep_utils.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", - "btm/btm_acl.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", @@ -93,7 +105,6 @@ static_library("stack") { "btm/btm_inq.cc", "btm/btm_iso.cc", "btm/btm_main.cc", - "btm/btm_pm.cc", "btm/btm_sco.cc", "btm/btm_sec.cc", "btu/btu_hcif.cc", @@ -149,7 +160,8 @@ static_library("stack") { "smp/smp_api.cc", "smp/smp_br_main.cc", "smp/smp_keys.cc", - "smp/smp_l2c.cc", + # Disable temporarily due to libcutils dependency + #"smp/smp_l2c.cc", "smp/smp_main.cc", "smp/smp_utils.cc", "srvc/srvc_dis.cc", @@ -157,6 +169,7 @@ static_library("stack") { ] include_dirs = [ + ".", "include", "avct", "btm", @@ -172,31 +185,34 @@ static_library("stack") { "sdp", "smp", "srvc", - "//linux_include", - "//internal_include", - "//btcore/include", - "//vnd/include", - "//vnd/ble", - "//btif/include", - "//hci/include", - "//internal_include", - "//udrv/include", - "//rpc/include", - "//hcis", - "//ctrlr/include", - "//bta/include", - "//bta/sys", - "//utils/include", - "//", + "//bt/types", + "//bt/linux_include", + "//bt/internal_include", + "//bt/btcore/include", + "//bt/vnd/include", + "//bt/vnd/ble", + "//bt/btif/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/udrv/include", + "//bt/rpc/include", + "//bt/hcis", + "//bt/ctrlr/include", + "//bt/bta/include", + "//bt/bta/sys", + "//bt/utils/include", + "//bt/", ] deps = [ ":crypto_toolbox", - "//types", - "//third_party/libchrome:base", - "//third_party/libldac:libldacBT_enc", - "//third_party/libldac:libldacBT_abr", - "//third_party/aac:libFraunhoferAAC", + "//bt/types", + "//bt/gd/rust/shim:init_flags_bridge_header", + "//bt/third_party/proto_logging/stats:libbt-platform-protos", + ] + + configs += [ + "//bt:target_defaults", ] } @@ -209,21 +225,20 @@ executable("stack_unittests") { include_dirs = [ "include", - "//", - "//bta/eatt", - "//bta/include", - "//bta/sys", - "//btcore/include", - "//embdrv/sbc/encoder/include", - "//hci/include", - "//internal_include", - "//stack/a2dp", - "//stack/btm", - "//stack/include", - "//third_party/tinyxml2", - "//udrv/include", - "//utils/include", - "//vnd/include" + "//bt/", + "//bt/bta/eatt", + "//bt/bta/include", + "//bt/bta/sys", + "//bt/btcore/include", + "//bt/embdrv/sbc/encoder/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/a2dp", + "//bt/stack/btm", + "//bt/stack/include", + "//bt/udrv/include", + "//bt/utils/include", + "//bt/vnd/include" ] libs = [ @@ -237,16 +252,20 @@ executable("stack_unittests") { deps = [ ":stack", - "//osi", - "//btcore", - "//device", - "//embdrv/sbc", - "//embdrv/g722", - "//hci", - "//types", - "//main:bluetooth", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/osi", + "//bt/btcore", + "//bt/device", + "//bt/embdrv/sbc", + "//bt/embdrv/g722", + "//bt/hci", + "//bt/types", + "//bt/main:bluetooth", + ] + + configs += [ + "//bt:external_tinyxml2", + "//bt:external_gmock_main", + "//bt:external_libchrome", ] } @@ -257,13 +276,16 @@ executable("net_test_stack_crypto_toolbox") { ] include_dirs = [ - "//", + "//bt/", ] deps = [ ":crypto_toolbox", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:external_libchrome", ] } @@ -281,26 +303,25 @@ executable("net_test_stack_smp") { ] include_dirs = [ - "//", - "//linux_include", - "//internal_include", - "//btcore/include", - "//hci/include", - "//utils/include", - "//bta/include", - "//bta/sys", - "//btcore/include", - "//embdrv/sbc/encoder/include", - "//hci/include", - "//internal_include", - "//stack/a2dp", - "//stack/l2cap", - "//stack/btm", - "//stack/include", - "//third_party/tinyxml2", - "//udrv/include", - "//utils/include", - "//vnd/include" + "//bt/", + "//bt/linux_include", + "//bt/internal_include", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/utils/include", + "//bt/bta/include", + "//bt/bta/sys", + "//bt/btcore/include", + "//bt/embdrv/sbc/encoder/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/a2dp", + "//bt/stack/l2cap", + "//bt/stack/btm", + "//bt/stack/include", + "//bt/udrv/include", + "//bt/utils/include", + "//bt/vnd/include" ] libs = [ @@ -314,10 +335,14 @@ executable("net_test_stack_smp") { deps = [ ":crypto_toolbox", - "//osi", - "//types", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/osi", + "//bt/types", + ] + + configs += [ + "//bt:external_tinyxml2", + "//bt:external_gmock_main", + "//bt:target_defaults", ] } @@ -330,11 +355,11 @@ executable("net_test_stack_multi_adv") { include_dirs = [ "include", - "//", - "//btcore/include", - "//hci/include", - "//internal_include", - "//stack/btm", + "//bt/", + "//bt/btcore/include", + "//bt/hci/include", + "//bt/internal_include", + "//bt/stack/btm", ] libs = [ @@ -347,9 +372,12 @@ executable("net_test_stack_multi_adv") { ] deps = [ - "//types", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/types", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:target_defaults", ] } diff --git a/system/stack/a2dp/a2dp_aac_decoder.cc b/system/stack/a2dp/a2dp_aac_decoder.cc index 55c020d04898968d7cca217363c61c21ed2be6b3..0dcd5adf8a76d2d7703c43025f5fc7003cc9a647 100644 --- a/system/stack/a2dp/a2dp_aac_decoder.cc +++ b/system/stack/a2dp/a2dp_aac_decoder.cc @@ -18,7 +18,11 @@ #include "a2dp_aac_decoder.h" +#ifdef OS_ANDROID #include <aacdecoder_lib.h> +#else +#include <fdk-aac/aacdecoder_lib.h> +#endif #include <base/logging.h> #include "a2dp_aac.h" diff --git a/system/stack/a2dp/a2dp_aac_encoder.cc b/system/stack/a2dp/a2dp_aac_encoder.cc index b0f3dcb384ac80515c8bad70cac8e29aaf4c0228..171db39962365abc8cc6786300542e05b04cb77b 100644 --- a/system/stack/a2dp/a2dp_aac_encoder.cc +++ b/system/stack/a2dp/a2dp_aac_encoder.cc @@ -23,7 +23,11 @@ #include <stdio.h> #include <string.h> +#ifdef OS_ANDROID #include <aacenc_lib.h> +#else +#include <fdk-aac/aacenc_lib.h> +#endif #include <base/logging.h> #include "a2dp_aac.h" diff --git a/system/stack/btm/security_device_record.h b/system/stack/btm/security_device_record.h index e68ae93ccbe1a6ffd3d5bd1ad889aba7423b0f2f..fefa6ccf1ec52355eee8aefded0cedb8ccc5e702 100644 --- a/system/stack/btm/security_device_record.h +++ b/system/stack/btm/security_device_record.h @@ -19,6 +19,7 @@ #pragma once #include <base/strings/stringprintf.h> +#include <string.h> #include <cstdint> #include <string> diff --git a/system/stack/hcic/hciblecmds.cc b/system/stack/hcic/hciblecmds.cc index 92a15c3006ec6a9d9290fdb59b3b7500c663162b..bc18dd62d4bd014c6aaee4611901475aae6c0dfd 100644 --- a/system/stack/hcic/hciblecmds.cc +++ b/system/stack/hcic/hciblecmds.cc @@ -29,6 +29,8 @@ #include "hcidefs.h" #include "hcimsgs.h" +#include <bitset> + #include <base/bind.h> #include <stddef.h> #include <string.h> diff --git a/system/stack/include/bt_types.h b/system/stack/include/bt_types.h index 1fbdbd99128aeb442ed79344495112d01371e446..c1ac7e8c6c8ac4ce3c5e9d993982af6ac268f0fc 100644 --- a/system/stack/include/bt_types.h +++ b/system/stack/include/bt_types.h @@ -234,7 +234,7 @@ typedef struct { #define BT_HDR_SIZE (sizeof(BT_HDR)) -enum : uint16_t { +enum { BT_PSM_SDP = 0x0001, BT_PSM_RFCOMM = 0x0003, BT_PSM_TCS = 0x0005, @@ -667,7 +667,7 @@ typedef uint8_t COF[COF_LEN]; /* ciphering offset number */ /* Device Types */ -enum : uint8_t { +enum { BT_DEVICE_TYPE_BREDR = (1 << 0), BT_DEVICE_TYPE_BLE = (1 << 1), BT_DEVICE_TYPE_DUMO = BT_DEVICE_TYPE_BREDR | BT_DEVICE_TYPE_BLE, diff --git a/system/test/suite/BUILD.gn b/system/test/suite/BUILD.gn index 7e68a1a958817201d103bb2536ae0ba49e606425..2cb68f1c2f06cf85d2d64fd1bdeedc6d5f959430 100644 --- a/system/test/suite/BUILD.gn +++ b/system/test/suite/BUILD.gn @@ -22,19 +22,22 @@ executable("net_test_bluetooth") { ] include_dirs = [ - "//", - "//test/suite", + "//bt", + "//bt/test/suite", ] deps = [ - "//btcore", - "//main:bluetooth", - "//service:service", - "//service:service_unittests", - "//types:types_unittests", - "//third_party/libchrome:base", - "//osi", - "//third_party/googletest:gtest_main", + "//bt/btcore", + "//bt/main:bluetooth", + "//bt/service:service", + "//bt/service:service_unittests", + "//bt/types:types_unittests", + "//bt/osi", + ] + + configs += [ + "//bt:external_libchrome", + "//bt:external_gtest_main", ] libs = [ diff --git a/system/types/BUILD.gn b/system/types/BUILD.gn index fa9a4af4c166705a367e1651154722b1c7479051..08ab05cf00b7e3feec29fc2d0adb1d719e6a5b26 100644 --- a/system/types/BUILD.gn +++ b/system/types/BUILD.gn @@ -21,16 +21,15 @@ static_library("types") { sources = [ "bluetooth/uuid.cc", - "le_address.cc", "raw_address.cc", ] include_dirs = [ - "//", + "//bt/", ] - deps = [ - "//third_party/libchrome:base", + configs += [ + "//bt:external_libchrome", ] } @@ -42,7 +41,7 @@ executable("types_unittests") { ] include_dirs = [ - "//", + "//bt/", ] libs = [ @@ -55,8 +54,11 @@ executable("types_unittests") { ] deps = [ - "//types", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/types", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:external_libchrome", ] } diff --git a/system/types/bluetooth/uuid.cc b/system/types/bluetooth/uuid.cc index 28c67186bec48723390822f52efdb18d9c9d20b6..d05f4370f0caedfaf14a4ee6af5edcf2f357a167 100644 --- a/system/types/bluetooth/uuid.cc +++ b/system/types/bluetooth/uuid.cc @@ -20,6 +20,7 @@ #include <base/rand_util.h> #include <base/strings/stringprintf.h> +#include <string.h> #include <algorithm> namespace bluetooth { @@ -173,4 +174,4 @@ std::string Uuid::ToString() const { uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7], uu[8], uu[9], uu[10], uu[11], uu[12], uu[13], uu[14], uu[15]); } -} // namespace bluetooth \ No newline at end of file +} // namespace bluetooth diff --git a/system/udrv/BUILD.gn b/system/udrv/BUILD.gn index 3712bd4189c9493dc2dcb7ccd6f40934e5c91419..b42932e660356163449056873cc990de8cdc4682 100644 --- a/system/udrv/BUILD.gn +++ b/system/udrv/BUILD.gn @@ -22,10 +22,13 @@ source_set("udrv") { include_dirs = [ "include", "uipc", - "//", - "//internal_include", - "//stack/include", - "//utils/include", - "//third_party/libchrome", + "//bt/", + "//bt/internal_include", + "//bt/stack/include", + "//bt/utils/include", + ] + + configs += [ + "//bt:target_defaults" ] } diff --git a/system/utils/BUILD.gn b/system/utils/BUILD.gn index 46b7236d070b93843558d5abe17b2875f8a82e32..f92942d50a786a1ca98f521853c8625a4d383921 100644 --- a/system/utils/BUILD.gn +++ b/system/utils/BUILD.gn @@ -21,9 +21,16 @@ static_library("utils") { include_dirs = [ "include", - "//", - "//stack/include", - "//third_party/libchrome", - "//third_party/googletest/googletest/include/", + "//bt/", + "//bt/stack/include", + ] + + configs += [ + "//bt:target_defaults", + "//bt:external_gtest" + ] + + deps = [ + "//bt/gd/rust/shim:init_flags_bridge_header", ] } diff --git a/system/vendor_libs/test_vendor_lib/types/BUILD.gn b/system/vendor_libs/test_vendor_lib/types/BUILD.gn index 68f76e3c544f43411fc6729f89c3e8e65a891dca..dac333c32cf106e7f31b08b5b4a3db43075f59e7 100644 --- a/system/vendor_libs/test_vendor_lib/types/BUILD.gn +++ b/system/vendor_libs/test_vendor_lib/types/BUILD.gn @@ -26,11 +26,11 @@ static_library("types") { ] include_dirs = [ - "//", + "//bt", ] - deps = [ - "//third_party/libchrome:base", + configs += [ + "//bt:external_libchrome", ] } @@ -42,7 +42,7 @@ executable("types_unittests") { ] include_dirs = [ - "//", + "//bt", ] libs = [ @@ -55,8 +55,11 @@ executable("types_unittests") { ] deps = [ - "//types", - "//third_party/googletest:gmock_main", - "//third_party/libchrome:base", + "//bt/types", + ] + + configs += [ + "//bt:external_gmock_main", + "//bt:external_libchrome", ] }