Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "fluoride_osi_defaults", |
| 3 | defaults: ["fluoride_defaults"], |
| 4 | include_dirs: [ |
| 5 | "system/bt", |
Jakub Pawlowski | ecace46 | 2017-10-17 16:40:41 -0700 | [diff] [blame] | 6 | "system/bt/internal_include", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 7 | "system/bt/utils/include", |
| 8 | "system/bt/stack/include", |
Colin Cross | 6208435 | 2019-05-23 14:12:59 -0700 | [diff] [blame] | 9 | ], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 10 | } |
| 11 | |
| 12 | // Static libraries required by other modules |
| 13 | // ======================================================== |
| 14 | cc_test_library { |
| 15 | name: "libosi-AllocationTestHarness", |
| 16 | defaults: ["fluoride_osi_defaults"], |
| 17 | srcs: [ |
| 18 | "test/AllocationTestHarness.cc", |
| 19 | ], |
| 20 | host_supported: true, |
| 21 | shared: { |
Colin Cross | 6208435 | 2019-05-23 14:12:59 -0700 | [diff] [blame] | 22 | enabled: false, |
Hidehiko Abe | acbb5c1 | 2018-01-29 15:43:47 +0900 | [diff] [blame] | 23 | }, |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | cc_test_library { |
| 27 | name: "libosi-AlarmTestHarness", |
| 28 | defaults: ["fluoride_osi_defaults"], |
| 29 | srcs: [ |
| 30 | "test/AlarmTestHarness.cc", |
| 31 | ], |
| 32 | host_supported: true, |
| 33 | shared: { |
Colin Cross | 6208435 | 2019-05-23 14:12:59 -0700 | [diff] [blame] | 34 | enabled: false, |
Hidehiko Abe | acbb5c1 | 2018-01-29 15:43:47 +0900 | [diff] [blame] | 35 | }, |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 36 | } |
| 37 | |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 38 | // libosi static library for target |
| 39 | // ======================================================== |
| 40 | cc_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", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 53 | "src/fixed_queue.cc", |
| 54 | "src/future.cc", |
| 55 | "src/hash_map_utils.cc", |
| 56 | "src/list.cc", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 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", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 67 | "src/wakelock.cc", |
| 68 | ], |
| 69 | shared_libs: [ |
| 70 | "liblog", |
| 71 | ], |
Jack He | ad18de0 | 2018-03-03 00:03:25 -0800 | [diff] [blame] | 72 | static_libs: ["libbt-protos-lite"], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 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: { |
Dan Willemsen | f6b1716 | 2017-10-02 10:41:11 -0700 | [diff] [blame] | 78 | linux_glibc: { |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 79 | cflags: [ |
| 80 | "-D_GNU_SOURCE", |
| 81 | "-DOS_GENERIC", |
| 82 | ], |
| 83 | }, |
| 84 | }, |
| 85 | } |
| 86 | |
| 87 | // libosi unit tests for target and host |
| 88 | // ======================================================== |
| 89 | cc_test { |
| 90 | name: "net_test_osi", |
Dan Shi | cdc3c39 | 2017-03-31 17:12:37 -0700 | [diff] [blame] | 91 | test_suites: ["device-tests"], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 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", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 102 | "test/fixed_queue_test.cc", |
| 103 | "test/future_test.cc", |
| 104 | "test/hash_map_utils_test.cc", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 105 | "test/list_test.cc", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 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", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 112 | "test/wakelock_test.cc", |
| 113 | ], |
| 114 | shared_libs: [ |
| 115 | "liblog", |
| 116 | "libprotobuf-cpp-lite", |
| 117 | "libcutils", |
Jack He | 9d9df72 | 2018-12-20 15:46:17 -0800 | [diff] [blame] | 118 | "libcrypto", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 119 | ], |
| 120 | static_libs: [ |
Jack He | 6d11052 | 2018-07-25 21:43:01 -0700 | [diff] [blame] | 121 | "libbt-common", |
Jack He | ad18de0 | 2018-03-03 00:03:25 -0800 | [diff] [blame] | 122 | "libbt-protos-lite", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 123 | "libgmock", |
| 124 | "libosi", |
| 125 | ], |
| 126 | target: { |
Dan Willemsen | f6b1716 | 2017-10-02 10:41:11 -0700 | [diff] [blame] | 127 | linux_glibc: { |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 128 | cflags: ["-DOS_GENERIC"], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 129 | }, |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 130 | }, |
Pavlin Radoslavov | ee021ef | 2018-01-09 05:36:20 -0800 | [diff] [blame] | 131 | sanitize: { |
| 132 | cfi: false, |
| 133 | }, |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 134 | } |