| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 1 | // Copyright (C) 2008 The Android Open Source Project | 
|  | 2 | // | 
|  | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 4 | // you may not use this file except in compliance with the License. | 
|  | 5 | // You may obtain a copy of the License at | 
|  | 6 | // | 
|  | 7 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 8 | // | 
|  | 9 | // Unless required by applicable law or agreed to in writing, software | 
|  | 10 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 12 | // See the License for the specific language governing permissions and | 
|  | 13 | // limitations under the License. | 
|  | 14 |  | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 15 | cc_library_headers { | 
|  | 16 | name: "libutils_headers", | 
| Steven Moreland | 91527ed | 2017-04-11 12:43:16 -0700 | [diff] [blame] | 17 | vendor_available: true, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 18 | recovery_available: true, | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 19 | host_supported: true, | 
| dimitry | 454ba7e | 2019-05-16 13:48:17 +0200 | [diff] [blame] | 20 | native_bridge_supported: true, | 
| Steven Moreland | d3b4b2c | 2017-04-13 21:01:40 -0700 | [diff] [blame] | 21 |  | 
| Jaesoo Lee | 1e8ac0f | 2017-04-20 16:56:45 +0900 | [diff] [blame] | 22 | header_libs: [ | 
| Steven Moreland | 95d7cbb | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 23 | "liblog_headers", | 
| Jaesoo Lee | 1e8ac0f | 2017-04-20 16:56:45 +0900 | [diff] [blame] | 24 | "libsystem_headers", | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 25 | "libcutils_headers", | 
| Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 26 | "libprocessgroup_headers", | 
| Jaesoo Lee | 1e8ac0f | 2017-04-20 16:56:45 +0900 | [diff] [blame] | 27 | ], | 
|  | 28 | export_header_lib_headers: [ | 
| Steven Moreland | 95d7cbb | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 29 | "liblog_headers", | 
| Jaesoo Lee | 1e8ac0f | 2017-04-20 16:56:45 +0900 | [diff] [blame] | 30 | "libsystem_headers", | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 31 | "libcutils_headers", | 
| Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 32 | "libprocessgroup_headers", | 
| Jaesoo Lee | 1e8ac0f | 2017-04-20 16:56:45 +0900 | [diff] [blame] | 33 | ], | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 34 | export_include_dirs: ["include"], | 
| Steven Moreland | d3b4b2c | 2017-04-13 21:01:40 -0700 | [diff] [blame] | 35 |  | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 36 | target: { | 
| Steven Moreland | d3b4b2c | 2017-04-13 21:01:40 -0700 | [diff] [blame] | 37 | android: { | 
|  | 38 | header_libs: ["libbacktrace_headers"], | 
|  | 39 | export_header_lib_headers: ["libbacktrace_headers"], | 
|  | 40 | }, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 41 | linux_bionic: { | 
|  | 42 | enabled: true, | 
|  | 43 | }, | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 44 | windows: { | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 45 | enabled: true, | 
|  | 46 | }, | 
| Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 47 | }, | 
|  | 48 | } | 
|  | 49 |  | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 50 | cc_defaults { | 
|  | 51 | name: "libutils_defaults", | 
| Steven Moreland | 91527ed | 2017-04-11 12:43:16 -0700 | [diff] [blame] | 52 | vendor_available: true, | 
| Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 53 | recovery_available: true, | 
| Justin Yun | 9ca9245 | 2017-07-31 15:41:10 +0900 | [diff] [blame] | 54 | vndk: { | 
|  | 55 | enabled: true, | 
|  | 56 | support_system_process: true, | 
|  | 57 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 58 | host_supported: true, | 
|  | 59 |  | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 60 | cflags: [ | 
|  | 61 | "-Wall", | 
|  | 62 | "-Werror", | 
|  | 63 | ], | 
| Steven Moreland | b084bc3 | 2017-04-12 18:57:57 -0700 | [diff] [blame] | 64 | header_libs: [ | 
| Chih-Hung Hsieh | 502f486 | 2018-09-13 11:08:41 -0700 | [diff] [blame] | 65 | "libbase_headers", | 
| Steven Moreland | b084bc3 | 2017-04-12 18:57:57 -0700 | [diff] [blame] | 66 | "libutils_headers", | 
|  | 67 | ], | 
|  | 68 | export_header_lib_headers: [ | 
| Steven Moreland | b084bc3 | 2017-04-12 18:57:57 -0700 | [diff] [blame] | 69 | "libutils_headers", | 
|  | 70 | ], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 71 |  | 
| Steven Moreland | 1f64241 | 2017-06-26 13:52:06 -0700 | [diff] [blame] | 72 | shared_libs: [ | 
| Steven Moreland | e6132be | 2019-03-25 20:38:56 -0700 | [diff] [blame] | 73 | "libcutils", | 
| Steven Moreland | 1f64241 | 2017-06-26 13:52:06 -0700 | [diff] [blame] | 74 | "liblog", | 
|  | 75 | ], | 
| Steven Moreland | 1f64241 | 2017-06-26 13:52:06 -0700 | [diff] [blame] | 76 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 77 | arch: { | 
|  | 78 | mips: { | 
|  | 79 | cflags: ["-DALIGN_DOUBLE"], | 
|  | 80 | }, | 
|  | 81 | }, | 
|  | 82 |  | 
|  | 83 | target: { | 
|  | 84 | android: { | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 85 | cflags: ["-fvisibility=protected"], | 
|  | 86 |  | 
|  | 87 | shared_libs: [ | 
| Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 88 | "libprocessgroup", | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 89 | "libdl", | 
| Jiyong Park | 0b3c24b | 2017-05-26 17:57:18 +0900 | [diff] [blame] | 90 | "libvndksupport", | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 91 | ], | 
| Dan Willemsen | e16bdb1 | 2016-07-13 00:20:20 -0700 | [diff] [blame] | 92 |  | 
|  | 93 | sanitize: { | 
|  | 94 | misc_undefined: ["integer"], | 
|  | 95 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 96 | }, | 
|  | 97 |  | 
| Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 98 | recovery: { | 
|  | 99 | exclude_shared_libs: ["libvndksupport"], | 
|  | 100 | }, | 
|  | 101 |  | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 102 | linux_bionic: { | 
|  | 103 | enabled: true, | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 104 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 105 |  | 
|  | 106 | darwin: { | 
|  | 107 | cflags: ["-Wno-unused-parameter"], | 
|  | 108 | }, | 
|  | 109 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 110 | windows: { | 
| Dan Willemsen | 528f144 | 2017-11-29 18:06:11 -0800 | [diff] [blame] | 111 | cflags: [ | 
|  | 112 | // Under MinGW, ctype.h doesn't need multi-byte support | 
|  | 113 | "-DMB_CUR_MAX=1", | 
|  | 114 | "-Wno-unused-private-field", | 
|  | 115 | ], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 116 |  | 
|  | 117 | enabled: true, | 
|  | 118 | }, | 
|  | 119 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 120 | } | 
|  | 121 |  | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 122 | cc_library { | 
|  | 123 | name: "libutils", | 
|  | 124 | defaults: ["libutils_defaults"], | 
| dimitry | 454ba7e | 2019-05-16 13:48:17 +0200 | [diff] [blame] | 125 | native_bridge_supported: true, | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 126 |  | 
|  | 127 | srcs: [ | 
| Steven Moreland | 591cab8 | 2019-11-15 00:07:32 -0800 | [diff] [blame] | 128 | "Errors.cpp", | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 129 | "FileMap.cpp", | 
|  | 130 | "JenkinsHash.cpp", | 
|  | 131 | "NativeHandle.cpp", | 
|  | 132 | "Printer.cpp", | 
|  | 133 | "PropertyMap.cpp", | 
|  | 134 | "RefBase.cpp", | 
|  | 135 | "SharedBuffer.cpp", | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 136 | "StopWatch.cpp", | 
|  | 137 | "String8.cpp", | 
|  | 138 | "String16.cpp", | 
|  | 139 | "StrongPointer.cpp", | 
|  | 140 | "SystemClock.cpp", | 
|  | 141 | "Threads.cpp", | 
|  | 142 | "Timers.cpp", | 
|  | 143 | "Tokenizer.cpp", | 
|  | 144 | "Unicode.cpp", | 
|  | 145 | "VectorImpl.cpp", | 
|  | 146 | "misc.cpp", | 
|  | 147 | ], | 
|  | 148 |  | 
|  | 149 | target: { | 
|  | 150 | android: { | 
|  | 151 | srcs: [ | 
|  | 152 | "Trace.cpp", | 
|  | 153 | ], | 
|  | 154 | }, | 
|  | 155 | linux: { | 
| Josh Gao | f0ea1e6 | 2019-01-02 14:31:26 -0800 | [diff] [blame] | 156 | header_libs: ["libbase_headers"], | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 157 | srcs: [ | 
|  | 158 | "Looper.cpp", | 
|  | 159 | ], | 
|  | 160 | }, | 
|  | 161 | }, | 
|  | 162 | } | 
|  | 163 |  | 
|  | 164 | cc_library { | 
|  | 165 | name: "libutilscallstack", | 
|  | 166 | defaults: ["libutils_defaults"], | 
|  | 167 |  | 
|  | 168 | srcs: [ | 
|  | 169 | "CallStack.cpp", | 
|  | 170 | ], | 
|  | 171 |  | 
|  | 172 | arch: { | 
|  | 173 | mips: { | 
|  | 174 | cflags: ["-DALIGN_DOUBLE"], | 
|  | 175 | }, | 
|  | 176 | }, | 
|  | 177 |  | 
| Steven Moreland | e6132be | 2019-03-25 20:38:56 -0700 | [diff] [blame] | 178 | shared_libs: [ | 
|  | 179 | "libutils", | 
|  | 180 | "libbacktrace", | 
|  | 181 | ], | 
|  | 182 |  | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 183 | target: { | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 184 | linux: { | 
|  | 185 | srcs: [ | 
|  | 186 | "ProcessCallStack.cpp", | 
|  | 187 | ], | 
|  | 188 | }, | 
| Steven Moreland | d33a2ee | 2019-04-01 15:01:53 -0700 | [diff] [blame] | 189 | darwin: { | 
|  | 190 | enabled: false, | 
|  | 191 | }, | 
| Steven Moreland | e6132be | 2019-03-25 20:38:56 -0700 | [diff] [blame] | 192 | windows: { | 
|  | 193 | enabled: false, | 
|  | 194 | }, | 
| David Sehr | abfb9f3 | 2018-01-17 17:07:09 -0800 | [diff] [blame] | 195 | }, | 
|  | 196 | } | 
|  | 197 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 198 | cc_test { | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 199 | name: "libutils_test", | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 200 | host_supported: true, | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 201 |  | 
|  | 202 | srcs: [ | 
|  | 203 | "BitSet_test.cpp", | 
|  | 204 | "FileMap_test.cpp", | 
|  | 205 | "LruCache_test.cpp", | 
|  | 206 | "Mutex_test.cpp", | 
|  | 207 | "SharedBuffer_test.cpp", | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 208 | "String8_test.cpp", | 
| Vic Yang | 9fb93ed | 2019-09-05 13:18:27 -0700 | [diff] [blame] | 209 | "String16_test.cpp", | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 210 | "StrongPointer_test.cpp", | 
|  | 211 | "Unicode_test.cpp", | 
|  | 212 | "Vector_test.cpp", | 
|  | 213 | ], | 
|  | 214 |  | 
|  | 215 | target: { | 
|  | 216 | android: { | 
|  | 217 | srcs: [ | 
|  | 218 | "SystemClock_test.cpp", | 
|  | 219 | ], | 
|  | 220 | shared_libs: [ | 
|  | 221 | "libz", | 
|  | 222 | "liblog", | 
|  | 223 | "libcutils", | 
|  | 224 | "libutils", | 
|  | 225 | "libbase", | 
|  | 226 | ], | 
|  | 227 | }, | 
|  | 228 | linux: { | 
|  | 229 | srcs: [ | 
|  | 230 | "Looper_test.cpp", | 
|  | 231 | "RefBase_test.cpp", | 
|  | 232 | ], | 
|  | 233 | }, | 
|  | 234 | host: { | 
|  | 235 | static_libs: [ | 
|  | 236 | "libutils", | 
|  | 237 | "liblog", | 
|  | 238 | "libbase", | 
|  | 239 | ], | 
|  | 240 | }, | 
|  | 241 | }, | 
|  | 242 |  | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 243 | cflags: [ | 
|  | 244 | "-Wall", | 
|  | 245 | "-Wextra", | 
|  | 246 | "-Werror", | 
|  | 247 | "-Wthread-safety", | 
|  | 248 | ], | 
| Elliott Hughes | cb65c35 | 2019-02-20 15:23:34 -0800 | [diff] [blame] | 249 |  | 
|  | 250 | test_suites: ["device-tests"], | 
|  | 251 | } | 
|  | 252 |  | 
|  | 253 | // TODO: the test infrastructure isn't yet capable of running this, | 
|  | 254 | // so it's broken out into its own test so that the main libutils_tests | 
|  | 255 | // can be in presubmit even if this can't. | 
|  | 256 |  | 
|  | 257 | cc_test { | 
|  | 258 | name: "libutils_singleton_test", | 
|  | 259 | srcs: ["Singleton_test.cpp"], | 
|  | 260 | cflags: [ | 
|  | 261 | "-Wall", | 
|  | 262 | "-Werror", | 
|  | 263 | ], | 
|  | 264 | shared_libs: ["libbase"], | 
|  | 265 |  | 
|  | 266 | required: [ | 
|  | 267 | ":libutils_test_singleton1", | 
|  | 268 | ":libutils_test_singleton2", | 
|  | 269 | ], | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 270 | } | 
|  | 271 |  | 
|  | 272 | cc_test_library { | 
|  | 273 | name: "libutils_test_singleton1", | 
|  | 274 | host_supported: true, | 
|  | 275 | relative_install_path: "libutils_test", | 
|  | 276 | srcs: ["Singleton_test1.cpp"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 277 | cflags: [ | 
|  | 278 | "-Wall", | 
|  | 279 | "-Werror", | 
|  | 280 | ], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 281 | } | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 282 |  | 
|  | 283 | cc_test_library { | 
|  | 284 | name: "libutils_test_singleton2", | 
|  | 285 | host_supported: true, | 
|  | 286 | relative_install_path: "libutils_test", | 
|  | 287 | srcs: ["Singleton_test2.cpp"], | 
|  | 288 | cflags: [ | 
|  | 289 | "-Wall", | 
|  | 290 | "-Werror", | 
|  | 291 | ], | 
|  | 292 | shared_libs: ["libutils_test_singleton1"], | 
|  | 293 | } | 
| Steven Moreland | c732c03 | 2019-09-03 18:04:50 -0700 | [diff] [blame] | 294 |  | 
|  | 295 | cc_benchmark { | 
|  | 296 | name: "libutils_benchmark", | 
|  | 297 | srcs: ["Vector_benchmark.cpp"], | 
|  | 298 | shared_libs: ["libutils"], | 
|  | 299 | } |