1package { 2 // See: http://go/android-license-faq 3 // A large-scale-change added 'default_applicable_licenses' to import 4 // all of the 'license_kinds' from "system_bt_license" 5 // to get the below license kinds: 6 // SPDX-license-identifier-Apache-2.0 7 // SPDX-license-identifier-MIT 8 default_applicable_licenses: ["system_bt_license"], 9} 10 11cc_defaults { 12 name: "fluoride_osi_defaults", 13 defaults: ["fluoride_defaults"], 14 include_dirs: [ 15 "system/bt", 16 "system/bt/internal_include", 17 "system/bt/utils/include", 18 "system/bt/stack/include", 19 ], 20} 21 22// Static libraries required by other modules 23// ======================================================== 24cc_test_library { 25 name: "libosi-AllocationTestHarness", 26 defaults: ["fluoride_osi_defaults"], 27 srcs: [ 28 "test/AllocationTestHarness.cc", 29 ], 30 host_supported: true, 31 shared: { 32 enabled: false, 33 }, 34} 35 36cc_test_library { 37 name: "libosi-AlarmTestHarness", 38 defaults: ["fluoride_osi_defaults"], 39 srcs: [ 40 "test/AlarmTestHarness.cc", 41 ], 42 host_supported: true, 43 shared: { 44 enabled: false, 45 }, 46} 47 48// libosi static library for target 49// ======================================================== 50cc_library_static { 51 name: "libosi", 52 defaults: ["fluoride_osi_defaults"], 53 // TODO(mcchou): Remove socket_utils sources after platform specific 54 // dependencies are abstracted. 55 srcs: [ 56 "src/alarm.cc", 57 "src/allocation_tracker.cc", 58 "src/allocator.cc", 59 "src/array.cc", 60 "src/buffer.cc", 61 "src/compat.cc", 62 "src/config.cc", 63 "src/fixed_queue.cc", 64 "src/future.cc", 65 "src/hash_map_utils.cc", 66 "src/list.cc", 67 "src/mutex.cc", 68 "src/osi.cc", 69 "src/properties.cc", 70 "src/reactor.cc", 71 "src/ringbuffer.cc", 72 "src/semaphore.cc", 73 "src/socket.cc", 74 "src/socket_utils/socket_local_client.cc", 75 "src/socket_utils/socket_local_server.cc", 76 "src/thread.cc", 77 "src/wakelock.cc", 78 ], 79 shared_libs: [ 80 "liblog", 81 ], 82 static_libs: ["libbt-protos-lite"], 83 host_supported: true, 84 // TODO(armansito): Setting _GNU_SOURCE isn't very platform-independent but 85 // should be compatible for a Linux host OS. We should figure out what to do for 86 // a non-Linux host OS. 87 target: { 88 linux_glibc: { 89 cflags: [ 90 "-D_GNU_SOURCE", 91 "-DOS_GENERIC", 92 ], 93 }, 94 }, 95} 96 97// libosi unit tests for target and host 98// ======================================================== 99cc_test { 100 name: "net_test_osi", 101 test_suites: ["device-tests"], 102 defaults: ["fluoride_osi_defaults"], 103 host_supported: true, 104 srcs: [ 105 "test/AlarmTestHarness.cc", 106 "test/AllocationTestHarness.cc", 107 "test/alarm_test.cc", 108 "test/allocation_tracker_test.cc", 109 "test/allocator_test.cc", 110 "test/array_test.cc", 111 "test/config_test.cc", 112 "test/fixed_queue_test.cc", 113 "test/future_test.cc", 114 "test/hash_map_utils_test.cc", 115 "test/list_test.cc", 116 "test/properties_test.cc", 117 "test/rand_test.cc", 118 "test/reactor_test.cc", 119 "test/ringbuffer_test.cc", 120 "test/semaphore_test.cc", 121 "test/thread_test.cc", 122 "test/wakelock_test.cc", 123 ], 124 shared_libs: [ 125 "liblog", 126 "libprotobuf-cpp-lite", 127 "libcutils", 128 "libcrypto", 129 ], 130 static_libs: [ 131 "libbt-common", 132 "libbt-protos-lite", 133 "libgmock", 134 "libosi", 135 "libc++fs", 136 ], 137 target: { 138 linux_glibc: { 139 cflags: ["-DOS_GENERIC"], 140 }, 141 }, 142 sanitize: { 143 cfi: false, 144 }, 145} 146