| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 1 | // | 
|  | 2 | // Copyright (C) 2008 The Android Open Source Project | 
|  | 3 | // | 
|  | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | // you may not use this file except in compliance with the License. | 
|  | 6 | // You may obtain a copy of the License at | 
|  | 7 | // | 
|  | 8 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | // | 
|  | 10 | // Unless required by applicable law or agreed to in writing, software | 
|  | 11 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | // See the License for the specific language governing permissions and | 
|  | 14 | // limitations under the License. | 
|  | 15 | // | 
|  | 16 |  | 
|  | 17 | // some files must not be compiled when building against Mingw | 
|  | 18 | // they correspond to features not used by our host development tools | 
|  | 19 | // which are also hard or even impossible to port to native Win32 | 
|  | 20 | libcutils_nonwindows_sources = [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 21 | "fs.cpp", | 
| Elliott Hughes | 9d12725 | 2018-07-13 10:54:49 -0700 | [diff] [blame] | 22 | "hashmap.cpp", | 
| Jeff Sharkey | 53d37ba | 2017-11-09 17:41:09 -0700 | [diff] [blame] | 23 | "multiuser.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 24 | "socket_inaddr_any_server_unix.cpp", | 
|  | 25 | "socket_local_client_unix.cpp", | 
|  | 26 | "socket_local_server_unix.cpp", | 
|  | 27 | "socket_network_client_unix.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 28 | "sockets_unix.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 29 | "str_parms.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 30 | ] | 
|  | 31 |  | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 32 | cc_library_headers { | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 33 | name: "libcutils_headers", | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 34 | vendor_available: true, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 35 | recovery_available: true, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 36 | host_supported: true, | 
| dimitry | 051d5cb | 2019-05-16 14:17:00 +0200 | [diff] [blame] | 37 | native_bridge_supported: true, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 38 | export_include_dirs: ["include"], | 
|  | 39 | target: { | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 40 | vendor: { | 
| Steven Moreland | e1c834d | 2018-01-05 14:42:12 -0800 | [diff] [blame] | 41 | override_export_include_dirs: ["include_vndk"], | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 42 | }, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 43 | linux_bionic: { | 
|  | 44 | enabled: true, | 
|  | 45 | }, | 
|  | 46 | windows: { | 
|  | 47 | enabled: true, | 
|  | 48 | }, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 49 | }, | 
|  | 50 | } | 
|  | 51 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 52 | cc_library { | 
|  | 53 | name: "libcutils", | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 54 | vendor_available: true, | 
| Justin Yun | 9ca9245 | 2017-07-31 15:41:10 +0900 | [diff] [blame] | 55 | vndk: { | 
|  | 56 | enabled: true, | 
|  | 57 | support_system_process: true, | 
|  | 58 | }, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 59 | recovery_available: true, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 60 | host_supported: true, | 
| dimitry | 051d5cb | 2019-05-16 14:17:00 +0200 | [diff] [blame] | 61 | native_bridge_supported: true, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 62 | srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 63 | "config_utils.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 64 | "canned_fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 65 | "iosched_policy.cpp", | 
|  | 66 | "load_file.cpp", | 
|  | 67 | "native_handle.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 68 | "record_stream.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 69 | "sockets.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 70 | "strdup16to8.cpp", | 
|  | 71 | "strdup8to16.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 72 | "strlcpy.c", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 73 | "threads.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 74 | ], | 
|  | 75 |  | 
|  | 76 | target: { | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 77 | linux_bionic: { | 
|  | 78 | enabled: true, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 79 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 80 | not_windows: { | 
|  | 81 | srcs: libcutils_nonwindows_sources + [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 82 | "ashmem-host.cpp", | 
| Jiyong Park | a2159c4 | 2019-02-03 00:34:29 +0900 | [diff] [blame] | 83 | "fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 84 | "trace-host.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 85 | ], | 
|  | 86 | }, | 
|  | 87 | windows: { | 
| Steven Moreland | e6132be | 2019-03-25 20:38:56 -0700 | [diff] [blame] | 88 | host_ldlibs: ["-lws2_32"], | 
|  | 89 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 90 | srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 91 | "socket_inaddr_any_server_windows.cpp", | 
|  | 92 | "socket_network_client_windows.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 93 | "sockets_windows.cpp", | 
| David Sehr | eb2dd20 | 2018-12-20 12:59:36 -0800 | [diff] [blame] | 94 | "trace-host.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 95 | ], | 
|  | 96 |  | 
|  | 97 | enabled: true, | 
| Mark Salyzyn | 163ecc6 | 2017-05-02 08:56:15 -0700 | [diff] [blame] | 98 | cflags: [ | 
|  | 99 | "-D_GNU_SOURCE", | 
|  | 100 | ], | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 101 | }, | 
|  | 102 |  | 
|  | 103 | android: { | 
|  | 104 | srcs: libcutils_nonwindows_sources + [ | 
| Elliott Hughes | 7acb0d3 | 2019-03-21 14:42:55 -0700 | [diff] [blame] | 105 | "android_get_control_file.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 106 | "android_reboot.cpp", | 
|  | 107 | "ashmem-dev.cpp", | 
| Jiyong Park | a2159c4 | 2019-02-03 00:34:29 +0900 | [diff] [blame] | 108 | "fs_config.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 109 | "klog.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 110 | "partition_utils.cpp", | 
| Elliott Hughes | 4eacd70 | 2017-01-26 17:31:40 -0800 | [diff] [blame] | 111 | "properties.cpp", | 
| Chenbo Feng | baede73 | 2017-10-25 12:31:43 -0700 | [diff] [blame] | 112 | "qtaguid.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 113 | "trace-dev.cpp", | 
| Luis Hector Chavez | e97a4b9 | 2017-11-02 14:17:43 -0700 | [diff] [blame] | 114 | "uevent.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 115 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 116 | }, | 
|  | 117 |  | 
|  | 118 | android_arm: { | 
|  | 119 | srcs: ["arch-arm/memset32.S"], | 
|  | 120 | sanitize: { | 
|  | 121 | misc_undefined: ["integer"], | 
|  | 122 | }, | 
|  | 123 | }, | 
|  | 124 | android_arm64: { | 
|  | 125 | srcs: ["arch-arm64/android_memset.S"], | 
| Evgenii Stepanov | 54c7886 | 2017-01-31 16:33:53 -0800 | [diff] [blame] | 126 | sanitize: { | 
|  | 127 | misc_undefined: ["integer"], | 
|  | 128 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 129 | }, | 
|  | 130 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 131 | android_mips: { | 
|  | 132 | srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 133 | sanitize: { | 
|  | 134 | misc_undefined: ["integer"], | 
|  | 135 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 136 | }, | 
|  | 137 | android_mips64: { | 
|  | 138 | srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 139 | sanitize: { | 
|  | 140 | misc_undefined: ["integer"], | 
|  | 141 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 142 | }, | 
|  | 143 |  | 
|  | 144 | android_x86: { | 
|  | 145 | srcs: [ | 
|  | 146 | "arch-x86/android_memset16.S", | 
|  | 147 | "arch-x86/android_memset32.S", | 
|  | 148 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 149 | // TODO: This is to work around b/29412086. | 
|  | 150 | // Remove once __mulodi4 is available and move the "sanitize" block | 
|  | 151 | // to the android target. | 
|  | 152 | sanitize: { | 
|  | 153 | misc_undefined: [], | 
|  | 154 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 155 | }, | 
|  | 156 |  | 
|  | 157 | android_x86_64: { | 
|  | 158 | srcs: [ | 
|  | 159 | "arch-x86_64/android_memset16.S", | 
|  | 160 | "arch-x86_64/android_memset32.S", | 
|  | 161 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 162 | sanitize: { | 
|  | 163 | misc_undefined: ["integer"], | 
|  | 164 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 165 | }, | 
| Logan Chien | 25b742c | 2018-05-08 17:37:29 +0800 | [diff] [blame] | 166 |  | 
|  | 167 | vendor: { | 
|  | 168 | exclude_srcs: [ | 
|  | 169 | // qtaguid.cpp loads libnetd_client.so with dlopen().  Since | 
|  | 170 | // the interface of libnetd_client.so may vary between AOSP | 
|  | 171 | // releases, exclude qtaguid.cpp from the VNDK-SP variant. | 
|  | 172 | "qtaguid.cpp", | 
|  | 173 | ], | 
|  | 174 | } | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 175 | }, | 
|  | 176 |  | 
| Joel Fernandes | 5194404 | 2018-12-18 13:32:31 -0800 | [diff] [blame] | 177 | shared_libs: [ | 
|  | 178 | "liblog", | 
|  | 179 | "libbase", | 
|  | 180 | ], | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 181 | header_libs: [ | 
| Elliott Hughes | 9f49508 | 2018-04-25 14:52:50 -0700 | [diff] [blame] | 182 | "libbase_headers", | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 183 | "libcutils_headers", | 
|  | 184 | "libutils_headers", | 
| Suren Baghdasaryan | 1bd127b | 2019-01-25 05:30:52 +0000 | [diff] [blame] | 185 | "libprocessgroup_headers", | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 186 | ], | 
| Suren Baghdasaryan | 1bd127b | 2019-01-25 05:30:52 +0000 | [diff] [blame] | 187 | export_header_lib_headers: [ | 
|  | 188 | "libcutils_headers", | 
|  | 189 | "libprocessgroup_headers", | 
|  | 190 | ], | 
| Yifan Hong | b680712 | 2017-07-25 15:24:04 -0700 | [diff] [blame] | 191 | local_include_dirs: ["include"], | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 192 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 193 | cflags: [ | 
|  | 194 | "-Werror", | 
|  | 195 | "-Wall", | 
|  | 196 | "-Wextra", | 
|  | 197 | ], | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 198 | } | 
|  | 199 |  | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 200 | cc_defaults { | 
|  | 201 | name: "libcutils_test_default", | 
|  | 202 | srcs: ["sockets_test.cpp"], | 
|  | 203 |  | 
|  | 204 | target: { | 
|  | 205 | android: { | 
|  | 206 | srcs: [ | 
|  | 207 | "android_get_control_file_test.cpp", | 
|  | 208 | "android_get_control_socket_test.cpp", | 
|  | 209 | "ashmem_test.cpp", | 
|  | 210 | "fs_config_test.cpp", | 
|  | 211 | "memset_test.cpp", | 
|  | 212 | "multiuser_test.cpp", | 
|  | 213 | "properties_test.cpp", | 
|  | 214 | "sched_policy_test.cpp", | 
|  | 215 | "str_parms_test.cpp", | 
|  | 216 | "trace-dev_test.cpp", | 
|  | 217 | ], | 
|  | 218 | }, | 
|  | 219 |  | 
|  | 220 | not_windows: { | 
|  | 221 | srcs: [ | 
|  | 222 | "str_parms_test.cpp", | 
|  | 223 | ], | 
|  | 224 | }, | 
|  | 225 | }, | 
|  | 226 |  | 
|  | 227 | cflags: [ | 
|  | 228 | "-Wall", | 
|  | 229 | "-Wextra", | 
|  | 230 | "-Werror", | 
|  | 231 | ], | 
|  | 232 | } | 
|  | 233 |  | 
|  | 234 | test_libraries = [ | 
|  | 235 | "libcutils", | 
|  | 236 | "liblog", | 
|  | 237 | "libbase", | 
|  | 238 | "libjsoncpp", | 
|  | 239 | "libprocessgroup", | 
| Yifan Hong | 53e0deb | 2019-03-22 17:01:08 -0700 | [diff] [blame] | 240 | "libcgrouprc", | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 241 | ] | 
|  | 242 |  | 
|  | 243 | cc_test { | 
|  | 244 | name: "libcutils_test", | 
|  | 245 | test_suites: ["device-tests"], | 
|  | 246 | defaults: ["libcutils_test_default"], | 
|  | 247 | host_supported: true, | 
|  | 248 | shared_libs: test_libraries, | 
|  | 249 | } | 
|  | 250 |  | 
|  | 251 | cc_test { | 
|  | 252 | name: "libcutils_test_static", | 
|  | 253 | test_suites: ["device-tests"], | 
|  | 254 | defaults: ["libcutils_test_default"], | 
| Yifan Hong | 53e0deb | 2019-03-22 17:01:08 -0700 | [diff] [blame] | 255 | static_libs: [ | 
|  | 256 | "libc", | 
|  | 257 | "libcgrouprc_format", | 
|  | 258 | ] + test_libraries, | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 259 | stl: "libc++_static", | 
|  | 260 |  | 
|  | 261 | target: { | 
|  | 262 | android: { | 
|  | 263 | static_executable: true, | 
|  | 264 | }, | 
|  | 265 | windows: { | 
|  | 266 | host_ldlibs: ["-lws2_32"], | 
|  | 267 |  | 
|  | 268 | enabled: true, | 
|  | 269 | }, | 
|  | 270 | }, | 
|  | 271 | } |