| 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 = [ | 
| Mark Salyzyn | 52bd37e | 2016-11-07 09:39:30 -0800 | [diff] [blame] | 21 |     "android_get_control_file.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 22 |     "fs.cpp", | 
| Elliott Hughes | 9d12725 | 2018-07-13 10:54:49 -0700 | [diff] [blame] | 23 |     "hashmap.cpp", | 
| Jeff Sharkey | 53d37ba | 2017-11-09 17:41:09 -0700 | [diff] [blame] | 24 |     "multiuser.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 25 |     "socket_inaddr_any_server_unix.cpp", | 
 | 26 |     "socket_local_client_unix.cpp", | 
 | 27 |     "socket_local_server_unix.cpp", | 
 | 28 |     "socket_network_client_unix.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 29 |     "sockets_unix.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 30 |     "str_parms.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 31 | ] | 
 | 32 |  | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 33 | cc_library_headers { | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 34 |     name: "libcutils_headers", | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 35 |     vendor_available: true, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 36 |     recovery_available: true, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 37 |     host_supported: true, | 
 | 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, | 
 | 61 |     srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 62 |         "config_utils.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 63 |         "canned_fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 64 |         "iosched_policy.cpp", | 
 | 65 |         "load_file.cpp", | 
 | 66 |         "native_handle.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 67 |         "record_stream.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 68 |         "sockets.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 69 |         "strdup16to8.cpp", | 
 | 70 |         "strdup8to16.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 71 |         "strlcpy.c", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 72 |         "threads.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 73 |     ], | 
 | 74 |  | 
 | 75 |     target: { | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 76 |         linux_bionic: { | 
 | 77 |             enabled: true, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 78 |         }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 79 |         not_windows: { | 
 | 80 |             srcs: libcutils_nonwindows_sources + [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 81 |                 "ashmem-host.cpp", | 
| Jiyong Park | a2159c4 | 2019-02-03 00:34:29 +0900 | [diff] [blame] | 82 |                 "fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 83 |                 "trace-host.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 84 |             ], | 
 | 85 |         }, | 
 | 86 |         windows: { | 
 | 87 |             srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 88 |                 "socket_inaddr_any_server_windows.cpp", | 
 | 89 |                 "socket_network_client_windows.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 90 |                 "sockets_windows.cpp", | 
| David Sehr | eb2dd20 | 2018-12-20 12:59:36 -0800 | [diff] [blame] | 91 |                 "trace-host.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 92 |             ], | 
 | 93 |  | 
 | 94 |             enabled: true, | 
 | 95 |             shared: { | 
 | 96 |                 enabled: false, | 
 | 97 |             }, | 
| 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 | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 105 |                 "android_reboot.cpp", | 
 | 106 |                 "ashmem-dev.cpp", | 
| Jiyong Park | a2159c4 | 2019-02-03 00:34:29 +0900 | [diff] [blame] | 107 |                 "fs_config.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 108 |                 "klog.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 109 |                 "partition_utils.cpp", | 
| Elliott Hughes | 4eacd70 | 2017-01-26 17:31:40 -0800 | [diff] [blame] | 110 |                 "properties.cpp", | 
| Chenbo Feng | baede73 | 2017-10-25 12:31:43 -0700 | [diff] [blame] | 111 |                 "qtaguid.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 112 |                 "trace-dev.cpp", | 
| Luis Hector Chavez | e97a4b9 | 2017-11-02 14:17:43 -0700 | [diff] [blame] | 113 |                 "uevent.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 114 |             ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 115 |         }, | 
 | 116 |  | 
 | 117 |         android_arm: { | 
 | 118 |             srcs: ["arch-arm/memset32.S"], | 
 | 119 |             sanitize: { | 
 | 120 |                 misc_undefined: ["integer"], | 
 | 121 |             }, | 
 | 122 |         }, | 
 | 123 |         android_arm64: { | 
 | 124 |             srcs: ["arch-arm64/android_memset.S"], | 
| Evgenii Stepanov | 54c7886 | 2017-01-31 16:33:53 -0800 | [diff] [blame] | 125 |             sanitize: { | 
 | 126 |                 misc_undefined: ["integer"], | 
 | 127 |             }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 128 |         }, | 
 | 129 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 130 |         android_mips: { | 
 | 131 |             srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 132 |             sanitize: { | 
 | 133 |                 misc_undefined: ["integer"], | 
 | 134 |             }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 135 |         }, | 
 | 136 |         android_mips64: { | 
 | 137 |             srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 138 |             sanitize: { | 
 | 139 |                 misc_undefined: ["integer"], | 
 | 140 |             }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 141 |         }, | 
 | 142 |  | 
 | 143 |         android_x86: { | 
 | 144 |             srcs: [ | 
 | 145 |                 "arch-x86/android_memset16.S", | 
 | 146 |                 "arch-x86/android_memset32.S", | 
 | 147 |             ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 148 |             // TODO: This is to work around b/29412086. | 
 | 149 |             // Remove once __mulodi4 is available and move the "sanitize" block | 
 | 150 |             // to the android target. | 
 | 151 |             sanitize: { | 
 | 152 |                 misc_undefined: [], | 
 | 153 |             }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 154 |         }, | 
 | 155 |  | 
 | 156 |         android_x86_64: { | 
 | 157 |             srcs: [ | 
 | 158 |                 "arch-x86_64/android_memset16.S", | 
 | 159 |                 "arch-x86_64/android_memset32.S", | 
 | 160 |             ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 161 |             sanitize: { | 
 | 162 |                 misc_undefined: ["integer"], | 
 | 163 |             }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 164 |         }, | 
| Logan Chien | 25b742c | 2018-05-08 17:37:29 +0800 | [diff] [blame] | 165 |  | 
 | 166 |         vendor: { | 
 | 167 |             exclude_srcs: [ | 
 | 168 |                 // qtaguid.cpp loads libnetd_client.so with dlopen().  Since | 
 | 169 |                 // the interface of libnetd_client.so may vary between AOSP | 
 | 170 |                 // releases, exclude qtaguid.cpp from the VNDK-SP variant. | 
 | 171 |                 "qtaguid.cpp", | 
 | 172 |             ], | 
 | 173 |         } | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 174 |     }, | 
 | 175 |  | 
| Joel Fernandes | 5194404 | 2018-12-18 13:32:31 -0800 | [diff] [blame] | 176 |     shared_libs: [ | 
 | 177 |         "liblog", | 
 | 178 |         "libbase", | 
 | 179 |     ], | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 180 |     header_libs: [ | 
| Elliott Hughes | 9f49508 | 2018-04-25 14:52:50 -0700 | [diff] [blame] | 181 |         "libbase_headers", | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 182 |         "libcutils_headers", | 
 | 183 |         "libutils_headers", | 
| Suren Baghdasaryan | 1bd127b | 2019-01-25 05:30:52 +0000 | [diff] [blame] | 184 |         "libprocessgroup_headers", | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 185 |     ], | 
| Suren Baghdasaryan | 1bd127b | 2019-01-25 05:30:52 +0000 | [diff] [blame] | 186 |     export_header_lib_headers: [ | 
 | 187 |         "libcutils_headers", | 
 | 188 |         "libprocessgroup_headers", | 
 | 189 |     ], | 
| Yifan Hong | b680712 | 2017-07-25 15:24:04 -0700 | [diff] [blame] | 190 |     local_include_dirs: ["include"], | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 191 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 192 |     cflags: [ | 
 | 193 |         "-Werror", | 
 | 194 |         "-Wall", | 
 | 195 |         "-Wextra", | 
 | 196 |     ], | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 197 | } | 
 | 198 |  | 
| Elliott Hughes | 01705e4 | 2019-02-07 12:41:37 -0800 | [diff] [blame] | 199 | cc_defaults { | 
 | 200 |     name: "libcutils_test_default", | 
 | 201 |     srcs: ["sockets_test.cpp"], | 
 | 202 |  | 
 | 203 |     target: { | 
 | 204 |         android: { | 
 | 205 |             srcs: [ | 
 | 206 |                 "android_get_control_file_test.cpp", | 
 | 207 |                 "android_get_control_socket_test.cpp", | 
 | 208 |                 "ashmem_test.cpp", | 
 | 209 |                 "fs_config_test.cpp", | 
 | 210 |                 "memset_test.cpp", | 
 | 211 |                 "multiuser_test.cpp", | 
 | 212 |                 "properties_test.cpp", | 
 | 213 |                 "sched_policy_test.cpp", | 
 | 214 |                 "str_parms_test.cpp", | 
 | 215 |                 "trace-dev_test.cpp", | 
 | 216 |             ], | 
 | 217 |         }, | 
 | 218 |  | 
 | 219 |         not_windows: { | 
 | 220 |             srcs: [ | 
 | 221 |                 "str_parms_test.cpp", | 
 | 222 |             ], | 
 | 223 |         }, | 
 | 224 |     }, | 
 | 225 |  | 
 | 226 |     cflags: [ | 
 | 227 |         "-Wall", | 
 | 228 |         "-Wextra", | 
 | 229 |         "-Werror", | 
 | 230 |     ], | 
 | 231 | } | 
 | 232 |  | 
 | 233 | test_libraries = [ | 
 | 234 |     "libcutils", | 
 | 235 |     "liblog", | 
 | 236 |     "libbase", | 
 | 237 |     "libjsoncpp", | 
 | 238 |     "libprocessgroup", | 
 | 239 | ] | 
 | 240 |  | 
 | 241 | cc_test { | 
 | 242 |     name: "libcutils_test", | 
 | 243 |     test_suites: ["device-tests"], | 
 | 244 |     defaults: ["libcutils_test_default"], | 
 | 245 |     host_supported: true, | 
 | 246 |     shared_libs: test_libraries, | 
 | 247 | } | 
 | 248 |  | 
 | 249 | cc_test { | 
 | 250 |     name: "libcutils_test_static", | 
 | 251 |     test_suites: ["device-tests"], | 
 | 252 |     defaults: ["libcutils_test_default"], | 
 | 253 |     static_libs: ["libc"] + test_libraries, | 
 | 254 |     stl: "libc++_static", | 
 | 255 |  | 
 | 256 |     target: { | 
 | 257 |         android: { | 
 | 258 |             static_executable: true, | 
 | 259 |         }, | 
 | 260 |         windows: { | 
 | 261 |             host_ldlibs: ["-lws2_32"], | 
 | 262 |  | 
 | 263 |             enabled: true, | 
 | 264 |         }, | 
 | 265 |     }, | 
 | 266 | } |