blob: 8e5dbded7319b11f78cfc1d37c6822dbd2347bf0 [file] [log] [blame]
Jack Hee2eeff42016-12-07 18:25:17 -08001cc_defaults {
2 name: "fluoride_osi_defaults",
3 defaults: ["fluoride_defaults"],
4 include_dirs: [
5 "system/bt",
Jakub Pawlowskiecace462017-10-17 16:40:41 -07006 "system/bt/internal_include",
Jack Hee2eeff42016-12-07 18:25:17 -08007 "system/bt/osi/src/protos",
8 "system/bt/utils/include",
9 "system/bt/stack/include",
10 ]
11}
12
13// Static libraries required by other modules
14// ========================================================
15cc_test_library {
16 name: "libosi-AllocationTestHarness",
17 defaults: ["fluoride_osi_defaults"],
18 srcs: [
19 "test/AllocationTestHarness.cc",
20 ],
21 host_supported: true,
22 shared: {
23 enabled: false
24 }
25}
26
27cc_test_library {
28 name: "libosi-AlarmTestHarness",
29 defaults: ["fluoride_osi_defaults"],
30 srcs: [
31 "test/AlarmTestHarness.cc",
32 ],
33 host_supported: true,
34 shared: {
35 enabled: false
36 }
37}
38
39// Bluetooth Protobuf static library for target and host
40// ========================================================
41cc_library_static {
42 name: "libbt-protos",
43 defaults: ["fluoride_defaults"],
44 srcs: ["src/protos/bluetooth.proto"],
45 proto: {
46 export_proto_headers: true,
47 },
48 host_supported: true
49}
50
51
52// libosi static library for target
53// ========================================================
54cc_library_static {
55 name: "libosi",
56 defaults: ["fluoride_osi_defaults"],
57 // TODO(mcchou): Remove socket_utils sources after platform specific
58 // dependencies are abstracted.
59 srcs: [
60 "src/alarm.cc",
61 "src/allocation_tracker.cc",
62 "src/allocator.cc",
63 "src/array.cc",
64 "src/buffer.cc",
65 "src/compat.cc",
66 "src/config.cc",
Jack Hee2eeff42016-12-07 18:25:17 -080067 "src/fixed_queue.cc",
68 "src/future.cc",
69 "src/hash_map_utils.cc",
70 "src/list.cc",
71 "src/metrics.cc",
72 "src/mutex.cc",
73 "src/osi.cc",
74 "src/properties.cc",
75 "src/reactor.cc",
76 "src/ringbuffer.cc",
77 "src/semaphore.cc",
78 "src/socket.cc",
79 "src/socket_utils/socket_local_client.cc",
80 "src/socket_utils/socket_local_server.cc",
81 "src/thread.cc",
82 "src/time.cc",
83 "src/wakelock.cc",
84 ],
85 shared_libs: [
86 "liblog",
87 ],
88 static_libs: ["libbt-protos"],
89 host_supported: true,
90 // TODO(armansito): Setting _GNU_SOURCE isn't very platform-independent but
91 // should be compatible for a Linux host OS. We should figure out what to do for
92 // a non-Linux host OS.
93 target: {
94 darwin: {
95 enabled: false,
96 },
Dan Willemsenf6b17162017-10-02 10:41:11 -070097 linux_glibc: {
Jack Hee2eeff42016-12-07 18:25:17 -080098 cflags: [
99 "-D_GNU_SOURCE",
100 "-DOS_GENERIC",
101 ],
102 },
103 },
104}
105
106// libosi unit tests for target and host
107// ========================================================
108cc_test {
109 name: "net_test_osi",
Dan Shicdc3c392017-03-31 17:12:37 -0700110 test_suites: ["device-tests"],
Jack Hee2eeff42016-12-07 18:25:17 -0800111 defaults: ["fluoride_osi_defaults"],
112 host_supported: true,
113 srcs: [
114 "test/AlarmTestHarness.cc",
115 "test/AllocationTestHarness.cc",
116 "test/alarm_test.cc",
117 "test/allocation_tracker_test.cc",
118 "test/allocator_test.cc",
119 "test/array_test.cc",
120 "test/config_test.cc",
Jack Hee2eeff42016-12-07 18:25:17 -0800121 "test/fixed_queue_test.cc",
122 "test/future_test.cc",
123 "test/hash_map_utils_test.cc",
124 "test/leaky_bonded_queue_test.cc",
125 "test/list_test.cc",
126 "test/metrics_test.cc",
127 "test/properties_test.cc",
128 "test/rand_test.cc",
129 "test/reactor_test.cc",
130 "test/ringbuffer_test.cc",
131 "test/semaphore_test.cc",
132 "test/thread_test.cc",
133 "test/time_test.cc",
134 "test/wakelock_test.cc",
135 ],
136 shared_libs: [
137 "liblog",
138 "libprotobuf-cpp-lite",
139 "libcutils",
140 ],
141 static_libs: [
142 "libbt-protos",
143 "libgmock",
144 "libosi",
145 ],
146 target: {
Dan Willemsenf6b17162017-10-02 10:41:11 -0700147 linux_glibc: {
Jack Hee2eeff42016-12-07 18:25:17 -0800148 cflags: ["-DOS_GENERIC"],
Jack Hee2eeff42016-12-07 18:25:17 -0800149 },
150 darwin: {
151 enabled: false,
152 }
153 },
154}