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