| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 1 | // Copyright (C) 2017 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 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 15 | cc_defaults { | 
|  | 16 | name: "adb_defaults", | 
|  | 17 |  | 
|  | 18 | cflags: [ | 
|  | 19 | "-Wall", | 
|  | 20 | "-Wextra", | 
|  | 21 | "-Werror", | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 22 | "-Wexit-time-destructors", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 23 | "-Wno-unused-parameter", | 
|  | 24 | "-Wno-missing-field-initializers", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 25 | "-Wthread-safety", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 26 | "-Wvla", | 
| Bowgo Tsai | 9b30c0a | 2019-03-12 04:25:33 +0800 | [diff] [blame] | 27 | "-DADB_HOST=1",         // overridden by adbd_defaults | 
|  | 28 | "-DALLOW_ADBD_ROOT=0",  // overridden by adbd_defaults | 
| Josh Gao | 27241a7 | 2019-04-25 14:04:57 -0700 | [diff] [blame] | 29 | "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION=1", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 30 | ], | 
| Josh Gao | 6eb7882 | 2018-11-16 15:40:16 -0800 | [diff] [blame] | 31 | cpp_std: "experimental", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 32 |  | 
| Josh Gao | c7567fa | 2018-02-27 15:49:23 -0800 | [diff] [blame] | 33 | use_version_lib: true, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 34 | compile_multilib: "first", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 35 |  | 
|  | 36 | target: { | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 37 | darwin: { | 
|  | 38 | host_ldlibs: [ | 
|  | 39 | "-lpthread", | 
|  | 40 | "-framework CoreFoundation", | 
|  | 41 | "-framework IOKit", | 
|  | 42 | "-lobjc", | 
|  | 43 | ], | 
|  | 44 | }, | 
|  | 45 |  | 
|  | 46 | windows: { | 
|  | 47 | cflags: [ | 
|  | 48 | // Define windows.h and tchar.h Unicode preprocessor symbols so that | 
|  | 49 | // CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the | 
|  | 50 | // build if you accidentally pass char*. Fix by calling like: | 
|  | 51 | //   std::wstring path_wide; | 
|  | 52 | //   if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ } | 
|  | 53 | //   CreateFileW(path_wide.c_str()); | 
|  | 54 | "-DUNICODE=1", | 
|  | 55 | "-D_UNICODE=1", | 
|  | 56 |  | 
| Elliott Hughes | 3c59cb8 | 2018-12-03 09:02:18 -0800 | [diff] [blame] | 57 | // Unlike on Linux, -std=gnu++ doesn't set _GNU_SOURCE on Windows. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 58 | "-D_GNU_SOURCE", | 
| Josh Gao | 2e1e789 | 2018-03-23 13:03:28 -0700 | [diff] [blame] | 59 |  | 
|  | 60 | // MinGW hides some things behind _POSIX_SOURCE. | 
|  | 61 | "-D_POSIX_SOURCE", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 62 |  | 
| Josh Gao | 4710e53 | 2019-04-17 16:57:43 -0700 | [diff] [blame] | 63 | // libusb uses __stdcall on a variadic function, which gets ignored. | 
|  | 64 | "-Wno-ignored-attributes", | 
|  | 65 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 66 | // Not supported yet. | 
|  | 67 | "-Wno-thread-safety", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 68 | ], | 
| Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 69 |  | 
|  | 70 | host_ldlibs: [ | 
|  | 71 | "-lws2_32", | 
|  | 72 | "-lgdi32", | 
|  | 73 | "-luserenv", | 
|  | 74 | ], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 75 | }, | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 76 | }, | 
|  | 77 | } | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 78 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 79 | cc_defaults { | 
|  | 80 | name: "adbd_defaults", | 
|  | 81 | defaults: ["adb_defaults"], | 
|  | 82 |  | 
|  | 83 | cflags: ["-UADB_HOST", "-DADB_HOST=0"], | 
|  | 84 | product_variables: { | 
|  | 85 | debuggable: { | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 86 | cflags: [ | 
| Bowgo Tsai | 9b30c0a | 2019-03-12 04:25:33 +0800 | [diff] [blame] | 87 | "-UALLOW_ADBD_ROOT", | 
|  | 88 | "-DALLOW_ADBD_ROOT=1", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 89 | "-DALLOW_ADBD_DISABLE_VERITY", | 
|  | 90 | "-DALLOW_ADBD_NO_AUTH", | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 91 | ], | 
|  | 92 | }, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 93 | }, | 
|  | 94 | } | 
|  | 95 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 96 | cc_defaults { | 
|  | 97 | name: "host_adbd_supported", | 
|  | 98 |  | 
|  | 99 | host_supported: true, | 
|  | 100 | target: { | 
|  | 101 | linux: { | 
|  | 102 | enabled: true, | 
|  | 103 | host_ldlibs: [ | 
|  | 104 | "-lresolv", // b64_pton | 
|  | 105 | "-lutil", // forkpty | 
|  | 106 | ], | 
|  | 107 | }, | 
|  | 108 | darwin: { | 
|  | 109 | enabled: false, | 
|  | 110 | }, | 
|  | 111 | windows: { | 
|  | 112 | enabled: false, | 
|  | 113 | }, | 
|  | 114 | }, | 
|  | 115 | } | 
|  | 116 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 117 | // libadb | 
|  | 118 | // ========================================================= | 
|  | 119 | // These files are compiled for both the host and the device. | 
|  | 120 | libadb_srcs = [ | 
|  | 121 | "adb.cpp", | 
|  | 122 | "adb_io.cpp", | 
|  | 123 | "adb_listeners.cpp", | 
|  | 124 | "adb_trace.cpp", | 
| Josh Gao | 6e1246c | 2018-05-24 22:54:50 -0700 | [diff] [blame] | 125 | "adb_unique_fd.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 126 | "adb_utils.cpp", | 
| Josh Gao | 57e09b1 | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 127 | "fdevent/fdevent.cpp", | 
| Josh Gao | 95068bb | 2019-07-08 15:23:17 -0700 | [diff] [blame] | 128 | "fdevent/fdevent_poll.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 129 | "services.cpp", | 
|  | 130 | "sockets.cpp", | 
|  | 131 | "socket_spec.cpp", | 
|  | 132 | "sysdeps/errno.cpp", | 
|  | 133 | "transport.cpp", | 
| Josh Gao | 6082e7d | 2018-04-05 16:16:04 -0700 | [diff] [blame] | 134 | "transport_fd.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 135 | "transport_local.cpp", | 
|  | 136 | "transport_usb.cpp", | 
|  | 137 | ] | 
|  | 138 |  | 
|  | 139 | libadb_posix_srcs = [ | 
|  | 140 | "sysdeps_unix.cpp", | 
|  | 141 | "sysdeps/posix/network.cpp", | 
|  | 142 | ] | 
|  | 143 |  | 
|  | 144 | libadb_test_srcs = [ | 
|  | 145 | "adb_io_test.cpp", | 
|  | 146 | "adb_listeners_test.cpp", | 
|  | 147 | "adb_utils_test.cpp", | 
| Josh Gao | 57e09b1 | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 148 | "fdevent/fdevent_test.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 149 | "socket_spec_test.cpp", | 
|  | 150 | "socket_test.cpp", | 
|  | 151 | "sysdeps_test.cpp", | 
|  | 152 | "sysdeps/stat_test.cpp", | 
|  | 153 | "transport_test.cpp", | 
| Josh Gao | 7c738cd | 2018-04-03 14:37:11 -0700 | [diff] [blame] | 154 | "types_test.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 155 | ] | 
|  | 156 |  | 
|  | 157 | cc_library_host_static { | 
|  | 158 | name: "libadb_host", | 
|  | 159 | defaults: ["adb_defaults"], | 
|  | 160 |  | 
|  | 161 | srcs: libadb_srcs + [ | 
|  | 162 | "client/auth.cpp", | 
|  | 163 | "client/usb_libusb.cpp", | 
|  | 164 | "client/usb_dispatch.cpp", | 
|  | 165 | "client/transport_mdns.cpp", | 
|  | 166 | ], | 
|  | 167 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 168 | generated_headers: ["platform_tools_version"], | 
|  | 169 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 170 | target: { | 
|  | 171 | linux: { | 
|  | 172 | srcs: ["client/usb_linux.cpp"], | 
|  | 173 | }, | 
|  | 174 | darwin: { | 
|  | 175 | srcs: ["client/usb_osx.cpp"], | 
|  | 176 | }, | 
|  | 177 |  | 
|  | 178 | not_windows: { | 
|  | 179 | srcs: libadb_posix_srcs, | 
|  | 180 | }, | 
|  | 181 | windows: { | 
|  | 182 | enabled: true, | 
|  | 183 | srcs: [ | 
|  | 184 | "client/usb_windows.cpp", | 
|  | 185 | "sysdeps_win32.cpp", | 
|  | 186 | "sysdeps/win32/errno.cpp", | 
|  | 187 | "sysdeps/win32/stat.cpp", | 
|  | 188 | ], | 
|  | 189 | shared_libs: ["AdbWinApi"], | 
|  | 190 | }, | 
|  | 191 | }, | 
|  | 192 |  | 
|  | 193 | static_libs: [ | 
|  | 194 | "libbase", | 
|  | 195 | "libcrypto_utils", | 
|  | 196 | "libcrypto", | 
|  | 197 | "libdiagnose_usb", | 
|  | 198 | "libmdnssd", | 
|  | 199 | "libusb", | 
| Idries Hamadi | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 200 | "libutils", | 
|  | 201 | "liblog", | 
|  | 202 | "libcutils", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 203 | ], | 
|  | 204 | } | 
|  | 205 |  | 
|  | 206 | cc_test_host { | 
|  | 207 | name: "adb_test", | 
|  | 208 | defaults: ["adb_defaults"], | 
|  | 209 | srcs: libadb_test_srcs, | 
|  | 210 | static_libs: [ | 
|  | 211 | "libadb_host", | 
|  | 212 | "libbase", | 
|  | 213 | "libcutils", | 
|  | 214 | "libcrypto_utils", | 
|  | 215 | "libcrypto", | 
|  | 216 | "libmdnssd", | 
|  | 217 | "libdiagnose_usb", | 
|  | 218 | "libusb", | 
|  | 219 | ], | 
| Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 220 |  | 
|  | 221 | target: { | 
|  | 222 | windows: { | 
|  | 223 | enabled: true, | 
|  | 224 | shared_libs: ["AdbWinApi"], | 
|  | 225 | }, | 
|  | 226 | }, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 227 | } | 
|  | 228 |  | 
| Josh Gao | 9c59649 | 2018-04-04 11:27:24 -0700 | [diff] [blame] | 229 | cc_benchmark { | 
|  | 230 | name: "adb_benchmark", | 
|  | 231 | defaults: ["adb_defaults"], | 
|  | 232 |  | 
|  | 233 | srcs: ["transport_benchmark.cpp"], | 
|  | 234 | target: { | 
|  | 235 | android: { | 
|  | 236 | static_libs: [ | 
|  | 237 | "libadbd", | 
|  | 238 | ], | 
|  | 239 | }, | 
|  | 240 | host: { | 
|  | 241 | static_libs: [ | 
|  | 242 | "libadb_host", | 
|  | 243 | ], | 
|  | 244 | }, | 
|  | 245 | }, | 
|  | 246 |  | 
|  | 247 | static_libs: [ | 
|  | 248 | "libbase", | 
|  | 249 | "libcutils", | 
|  | 250 | "libcrypto_utils", | 
|  | 251 | "libcrypto", | 
|  | 252 | "libdiagnose_usb", | 
|  | 253 | "liblog", | 
|  | 254 | "libusb", | 
|  | 255 | ], | 
|  | 256 | } | 
|  | 257 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 258 | cc_binary_host { | 
|  | 259 | name: "adb", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 260 |  | 
|  | 261 | defaults: ["adb_defaults"], | 
|  | 262 |  | 
|  | 263 | srcs: [ | 
|  | 264 | "client/adb_client.cpp", | 
|  | 265 | "client/bugreport.cpp", | 
|  | 266 | "client/commandline.cpp", | 
|  | 267 | "client/file_sync_client.cpp", | 
|  | 268 | "client/main.cpp", | 
|  | 269 | "client/console.cpp", | 
| Idries Hamadi | ed409ea | 2018-01-29 16:30:36 +0000 | [diff] [blame] | 270 | "client/adb_install.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 271 | "client/line_printer.cpp", | 
|  | 272 | "shell_service_protocol.cpp", | 
|  | 273 | ], | 
|  | 274 |  | 
|  | 275 | static_libs: [ | 
|  | 276 | "libadb_host", | 
|  | 277 | "libbase", | 
|  | 278 | "libcutils", | 
|  | 279 | "libcrypto_utils", | 
|  | 280 | "libcrypto", | 
|  | 281 | "libdiagnose_usb", | 
|  | 282 | "liblog", | 
|  | 283 | "libmdnssd", | 
|  | 284 | "libusb", | 
| Idries Hamadi | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 285 | "libutils", | 
|  | 286 | "liblog", | 
|  | 287 | "libcutils", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 288 | ], | 
|  | 289 |  | 
|  | 290 | stl: "libc++_static", | 
|  | 291 |  | 
|  | 292 | // Don't add anything here, we don't want additional shared dependencies | 
|  | 293 | // on the host adb tool, and shared libraries that link against libc++ | 
|  | 294 | // will violate ODR | 
|  | 295 | shared_libs: [], | 
|  | 296 |  | 
| Idries Hamadi | 7575cd9 | 2018-08-24 11:46:45 +0100 | [diff] [blame] | 297 | required: [ | 
|  | 298 | "deploypatchgenerator", | 
|  | 299 | ], | 
|  | 300 |  | 
| Dan Willemsen | 3f439a7 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 301 | // Archive adb, adb.exe. | 
|  | 302 | dist: { | 
|  | 303 | targets: [ | 
|  | 304 | "dist_files", | 
|  | 305 | "sdk", | 
|  | 306 | "win_sdk", | 
|  | 307 | ], | 
|  | 308 | }, | 
|  | 309 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 310 | target: { | 
|  | 311 | darwin: { | 
|  | 312 | cflags: [ | 
|  | 313 | "-Wno-sizeof-pointer-memaccess", | 
|  | 314 | ], | 
|  | 315 | }, | 
|  | 316 | windows: { | 
|  | 317 | enabled: true, | 
|  | 318 | ldflags: ["-municode"], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 319 | shared_libs: ["AdbWinApi"], | 
|  | 320 | required: [ | 
|  | 321 | "AdbWinUsbApi", | 
|  | 322 | ], | 
|  | 323 | }, | 
|  | 324 | }, | 
|  | 325 | } | 
|  | 326 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 327 | // libadbd_core contains the common sources to build libadbd and libadbd_services. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 328 | cc_library_static { | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 329 | name: "libadbd_core", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 330 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 331 | recovery_available: true, | 
|  | 332 |  | 
|  | 333 | // libminadbd wants both, as it's used to build native tests. | 
|  | 334 | compile_multilib: "both", | 
|  | 335 |  | 
|  | 336 | srcs: libadb_srcs + libadb_posix_srcs + [ | 
|  | 337 | "daemon/auth.cpp", | 
|  | 338 | "daemon/jdwp_service.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 339 | ], | 
|  | 340 |  | 
|  | 341 | local_include_dirs: [ | 
|  | 342 | "daemon/include", | 
|  | 343 | ], | 
|  | 344 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 345 | generated_headers: ["platform_tools_version"], | 
|  | 346 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 347 | static_libs: [ | 
| Josh Gao | 5f2c5bb | 2019-06-19 14:14:57 -0700 | [diff] [blame] | 348 | "libadbconnection_server", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 349 | "libdiagnose_usb", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 350 | ], | 
|  | 351 |  | 
|  | 352 | shared_libs: [ | 
|  | 353 | "libasyncio", | 
|  | 354 | "libbase", | 
|  | 355 | "libcrypto", | 
|  | 356 | "libcrypto_utils", | 
|  | 357 | "libcutils", | 
|  | 358 | "liblog", | 
|  | 359 | ], | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 360 |  | 
|  | 361 | target: { | 
|  | 362 | android: { | 
|  | 363 | whole_static_libs: [ | 
|  | 364 | "libqemu_pipe", | 
|  | 365 | ], | 
|  | 366 | srcs: [ | 
|  | 367 | "daemon/transport_qemu.cpp", | 
|  | 368 | "daemon/usb.cpp", | 
|  | 369 | "daemon/usb_ffs.cpp", | 
|  | 370 | "daemon/usb_legacy.cpp", | 
|  | 371 | ] | 
|  | 372 | }, | 
|  | 373 | linux_glibc: { | 
|  | 374 | srcs: [ | 
|  | 375 | "daemon/usb_dummy.cpp", | 
|  | 376 | ] | 
|  | 377 | } | 
|  | 378 | }, | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 379 | } | 
|  | 380 |  | 
|  | 381 | cc_library { | 
|  | 382 | name: "libadbd_services", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 383 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 384 | recovery_available: true, | 
|  | 385 | compile_multilib: "both", | 
|  | 386 |  | 
|  | 387 | srcs: [ | 
|  | 388 | "daemon/file_sync_service.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 389 | "daemon/services.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 390 | "daemon/shell_service.cpp", | 
|  | 391 | "shell_service_protocol.cpp", | 
|  | 392 | ], | 
|  | 393 |  | 
|  | 394 | cflags: [ | 
|  | 395 | "-D_GNU_SOURCE", | 
|  | 396 | "-Wno-deprecated-declarations", | 
|  | 397 | ], | 
|  | 398 |  | 
|  | 399 | static_libs: [ | 
| Josh Gao | 5f2c5bb | 2019-06-19 14:14:57 -0700 | [diff] [blame] | 400 | "libadbconnection_server", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 401 | "libadbd_core", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 402 | "libdiagnose_usb", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 403 | ], | 
|  | 404 |  | 
|  | 405 | shared_libs: [ | 
|  | 406 | "libasyncio", | 
|  | 407 | "libbase", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 408 | "libcrypto", | 
|  | 409 | "libcrypto_utils", | 
|  | 410 | "libcutils", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 411 | "liblog", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 412 | ], | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 413 |  | 
| Mark Salyzyn | 2f6c180 | 2019-02-15 07:45:26 -0800 | [diff] [blame] | 414 | product_variables: { | 
|  | 415 | debuggable: { | 
|  | 416 | required: [ | 
|  | 417 | "remount", | 
|  | 418 | ], | 
|  | 419 | }, | 
|  | 420 | }, | 
|  | 421 |  | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 422 | target: { | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 423 | android: { | 
|  | 424 | srcs: [ | 
|  | 425 | "daemon/abb_service.cpp", | 
|  | 426 | "daemon/framebuffer_service.cpp", | 
|  | 427 | "daemon/mdns.cpp", | 
|  | 428 | "daemon/reboot_service.cpp", | 
|  | 429 | "daemon/remount_service.cpp", | 
|  | 430 | "daemon/restart_service.cpp", | 
|  | 431 | "daemon/set_verity_enable_state_service.cpp", | 
|  | 432 | ], | 
|  | 433 | static_libs: [ | 
|  | 434 | "libavb_user", | 
|  | 435 | ], | 
|  | 436 | shared_libs: [ | 
|  | 437 | "libbootloader_message", | 
|  | 438 | "libmdnssd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 439 | "libfec", | 
|  | 440 | "libfs_mgr", | 
|  | 441 | "libselinux", | 
|  | 442 | ], | 
|  | 443 | }, | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 444 | recovery: { | 
|  | 445 | exclude_srcs: [ | 
|  | 446 | "daemon/abb_service.cpp", | 
|  | 447 | ], | 
|  | 448 | }, | 
|  | 449 | }, | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 450 | } | 
|  | 451 |  | 
|  | 452 | cc_library { | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 453 | name: "libadbd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 454 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 455 | recovery_available: true, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 456 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 457 | // Avoid getting duplicate symbol of android::build::GetBuildNumber(). | 
|  | 458 | use_version_lib: false, | 
|  | 459 |  | 
|  | 460 | // libminadbd wants both, as it's used to build native tests. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 461 | compile_multilib: "both", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 462 |  | 
|  | 463 | // libadbd doesn't build any additional source, but to expose libadbd_core as a shared library. | 
|  | 464 | whole_static_libs: [ | 
|  | 465 | "libadbd_core", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 466 | ], | 
|  | 467 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 468 | shared_libs: [ | 
|  | 469 | "libadbd_services", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 470 | "libasyncio", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 471 | "libbase", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 472 | "libcrypto", | 
|  | 473 | "libcrypto_utils", | 
|  | 474 | "libcutils", | 
|  | 475 | "liblog", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 476 | ], | 
| Jerry Zhang | b156c60 | 2018-05-07 15:14:47 -0700 | [diff] [blame] | 477 |  | 
|  | 478 | export_include_dirs: [ | 
|  | 479 | "daemon/include", | 
|  | 480 | ], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 481 | } | 
|  | 482 |  | 
|  | 483 | cc_binary { | 
|  | 484 | name: "adbd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 485 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 486 | recovery_available: true, | 
| Josh Gao | 8db99f8 | 2018-03-06 12:57:27 -0800 | [diff] [blame] | 487 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 488 | srcs: [ | 
|  | 489 | "daemon/main.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 490 | ], | 
|  | 491 |  | 
|  | 492 | cflags: [ | 
|  | 493 | "-D_GNU_SOURCE", | 
|  | 494 | "-Wno-deprecated-declarations", | 
|  | 495 | ], | 
|  | 496 |  | 
|  | 497 | strip: { | 
|  | 498 | keep_symbols: true, | 
|  | 499 | }, | 
|  | 500 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 501 | shared_libs: [ | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 502 | "libadbd", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 503 | "libadbd_services", | 
|  | 504 | "libbase", | 
|  | 505 | "libcap", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 506 | "libcrypto", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 507 | "libcutils", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 508 | "liblog", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 509 | "libminijail", | 
|  | 510 | "libselinux", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 511 | ], | 
|  | 512 | } | 
|  | 513 |  | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 514 | cc_binary { | 
| Josh Gao | bde8c84 | 2019-05-01 18:25:14 -0700 | [diff] [blame] | 515 | name: "static_adbd", | 
|  | 516 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
|  | 517 |  | 
|  | 518 | recovery_available: false, | 
|  | 519 | static_executable: true, | 
|  | 520 | host_supported: false, | 
|  | 521 |  | 
|  | 522 | srcs: [ | 
|  | 523 | "daemon/main.cpp", | 
|  | 524 | ], | 
|  | 525 |  | 
|  | 526 | cflags: [ | 
|  | 527 | "-D_GNU_SOURCE", | 
|  | 528 | "-Wno-deprecated-declarations", | 
|  | 529 | ], | 
|  | 530 |  | 
|  | 531 | strip: { | 
|  | 532 | keep_symbols: true, | 
|  | 533 | }, | 
|  | 534 |  | 
|  | 535 | static_libs: [ | 
| Josh Gao | 5f2c5bb | 2019-06-19 14:14:57 -0700 | [diff] [blame] | 536 | "libadbconnection_server", | 
| Josh Gao | bde8c84 | 2019-05-01 18:25:14 -0700 | [diff] [blame] | 537 | "libadbd", | 
|  | 538 | "libadbd_services", | 
|  | 539 | "libasyncio", | 
|  | 540 | "libavb_user", | 
|  | 541 | "libbase", | 
|  | 542 | "libbootloader_message", | 
|  | 543 | "libcap", | 
|  | 544 | "libcrypto", | 
|  | 545 | "libcrypto_utils", | 
|  | 546 | "libcutils", | 
|  | 547 | "libdiagnose_usb", | 
|  | 548 | "libext4_utils", | 
|  | 549 | "libfec", | 
|  | 550 | "libfec_rs", | 
|  | 551 | "libfs_mgr", | 
|  | 552 | "liblog", | 
|  | 553 | "liblp", | 
|  | 554 | "libmdnssd", | 
|  | 555 | "libminijail", | 
|  | 556 | "libselinux", | 
|  | 557 | "libsquashfs_utils", | 
|  | 558 | ], | 
|  | 559 | } | 
|  | 560 |  | 
|  | 561 | cc_binary { | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 562 | name: "abb", | 
|  | 563 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 564 | defaults: ["adbd_defaults"], | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 565 | recovery_available: false, | 
|  | 566 |  | 
|  | 567 | srcs: [ | 
|  | 568 | "daemon/abb.cpp", | 
|  | 569 | ], | 
|  | 570 |  | 
|  | 571 | cflags: [ | 
|  | 572 | "-D_GNU_SOURCE", | 
|  | 573 | "-Wno-deprecated-declarations", | 
|  | 574 | ], | 
|  | 575 |  | 
|  | 576 | strip: { | 
|  | 577 | keep_symbols: true, | 
|  | 578 | }, | 
|  | 579 |  | 
|  | 580 | static_libs: [ | 
|  | 581 | "libadbd_core", | 
|  | 582 | "libadbd_services", | 
|  | 583 | "libcmd", | 
|  | 584 | ], | 
|  | 585 |  | 
|  | 586 | shared_libs: [ | 
|  | 587 | "libbase", | 
|  | 588 | "libbinder", | 
|  | 589 | "liblog", | 
|  | 590 | "libutils", | 
|  | 591 | "libselinux", | 
|  | 592 | ], | 
|  | 593 | } | 
|  | 594 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 595 | cc_test { | 
|  | 596 | name: "adbd_test", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 597 | defaults: ["adbd_defaults"], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 598 | srcs: libadb_test_srcs + [ | 
| Josh Gao | 997cfac | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 599 | "daemon/services.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 600 | "daemon/shell_service.cpp", | 
|  | 601 | "daemon/shell_service_test.cpp", | 
|  | 602 | "shell_service_protocol.cpp", | 
|  | 603 | "shell_service_protocol_test.cpp", | 
|  | 604 | ], | 
|  | 605 |  | 
|  | 606 | static_libs: [ | 
|  | 607 | "libadbd", | 
|  | 608 | "libbase", | 
| Josh Gao | 997cfac | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 609 | "libbootloader_message", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 610 | "libcutils", | 
|  | 611 | "libcrypto_utils", | 
|  | 612 | "libcrypto", | 
|  | 613 | "libdiagnose_usb", | 
|  | 614 | "liblog", | 
|  | 615 | "libusb", | 
|  | 616 | "libmdnssd", | 
| Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 617 | "libselinux", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 618 | ], | 
| Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 619 | test_suites: ["device-tests"], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 620 | } | 
|  | 621 |  | 
| Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 622 | python_test_host { | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 623 | name: "adb_integration_test_adb", | 
|  | 624 | main: "test_adb.py", | 
|  | 625 | srcs: [ | 
|  | 626 | "test_adb.py", | 
|  | 627 | ], | 
| Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 628 | test_config: "adb_integration_test_adb.xml", | 
|  | 629 | test_suites: ["general-tests"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 630 | version: { | 
|  | 631 | py2: { | 
| Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 632 | enabled: false, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 633 | }, | 
|  | 634 | py3: { | 
| Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 635 | enabled: true, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 636 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 637 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 638 | } | 
|  | 639 |  | 
| Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 640 | python_test_host { | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 641 | name: "adb_integration_test_device", | 
|  | 642 | main: "test_device.py", | 
|  | 643 | srcs: [ | 
|  | 644 | "test_device.py", | 
|  | 645 | ], | 
|  | 646 | libs: [ | 
|  | 647 | "adb_py", | 
|  | 648 | ], | 
| Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 649 | test_config: "adb_integration_test_device.xml", | 
|  | 650 | test_suites: ["general-tests"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 651 | version: { | 
|  | 652 | py2: { | 
|  | 653 | enabled: true, | 
|  | 654 | }, | 
|  | 655 | py3: { | 
|  | 656 | enabled: false, | 
|  | 657 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 658 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 659 | } |