1// libbtcore static library for target and host 2package { 3 // See: http://go/android-license-faq 4 // A large-scale-change added 'default_applicable_licenses' to import 5 // all of the 'license_kinds' from "system_bt_license" 6 // to get the below license kinds: 7 // SPDX-license-identifier-Apache-2.0 8 default_applicable_licenses: ["system_bt_license"], 9} 10 11cc_defaults { 12 name: "libbtcore_defaults", 13 defaults: ["fluoride_defaults"], 14 local_include_dirs: ["include"], 15 include_dirs: [ 16 "packages/modules/Bluetooth/system", 17 "packages/modules/Bluetooth/system/gd", 18 ], 19 srcs: [ 20 "src/device_class.cc", 21 "src/module.cc", 22 "src/osi_module.cc", 23 "src/property.cc", 24 ], 25 header_libs: ["libbluetooth_headers"], 26 host_supported: true, 27 apex_available: [ 28 "com.android.btservices", 29 ], 30 target: { 31 host_linux: { 32 cflags: ["-D_GNU_SOURCE"], 33 }, 34 }, 35} 36 37cc_library_static { 38 name: "libbthalutils", 39 defaults: ["fluoride_defaults"], 40 srcs: [ 41 "src/hal_util.cc", 42 ], 43 local_include_dirs: ["include"], 44 include_dirs: [ 45 "packages/modules/Bluetooth/system", 46 "packages/modules/Bluetooth/system/gd", 47 ], 48 header_libs: ["libbluetooth_headers"], 49 host_supported: true, 50 apex_available: [ 51 "com.android.btservices", 52 ], 53 target: { 54 host_linux: { 55 cflags: ["-D_GNU_SOURCE"], 56 }, 57 }, 58 static_libs: [ 59 "libbluetooth_log", 60 ], 61} 62 63cc_library_static { 64 name: "libbtcore", 65 visibility: [ 66 "//packages/apps/Test/connectivity/sl4n", 67 "//packages/modules/Bluetooth:__subpackages__", 68 ], 69 defaults: ["libbtcore_defaults"], 70 min_sdk_version: "Tiramisu", 71 static_libs: [ 72 "libbluetooth_log", 73 ], 74} 75 76cc_library_headers { 77 name: "libbtcore_headers", 78 export_include_dirs: ["./"], 79 vendor_available: true, 80 host_supported: true, 81 apex_available: [ 82 "//apex_available:platform", 83 "com.android.btservices", 84 ], 85 min_sdk_version: "30", 86} 87 88// Note: It's good to get the tests compiled both for the host and the target so 89// we get to test with both Bionic libc and glibc 90// libbtcore unit tests for target and host 91cc_test { 92 name: "net_test_btcore", 93 test_suites: ["general-tests"], 94 defaults: [ 95 "fluoride_defaults", 96 "mts_defaults", 97 ], 98 local_include_dirs: ["include"], 99 include_dirs: ["packages/modules/Bluetooth/system"], 100 srcs: [ 101 "test/device_class_test.cc", 102 "test/property_test.cc", 103 ], 104 shared_libs: [ 105 "libbase", 106 "liblog", 107 ], 108 static_libs: [ 109 "libbluetooth-types", 110 "libbluetooth_log", 111 "libbtcore", 112 "libchrome", 113 "libcom.android.sysprop.bluetooth.wrapped", 114 "libosi", 115 ], 116 host_supported: true, 117 test_options: { 118 unit_test: true, 119 }, 120 sanitize: { 121 address: true, 122 }, 123 header_libs: ["libbluetooth_headers"], 124} 125