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", |
| 127 | "fdevent.cpp", |
| 128 | "services.cpp", |
| 129 | "sockets.cpp", |
| 130 | "socket_spec.cpp", |
| 131 | "sysdeps/errno.cpp", |
| 132 | "transport.cpp", |
Josh Gao | 6082e7d | 2018-04-05 16:16:04 -0700 | [diff] [blame] | 133 | "transport_fd.cpp", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 134 | "transport_local.cpp", |
| 135 | "transport_usb.cpp", |
| 136 | ] |
| 137 | |
| 138 | libadb_posix_srcs = [ |
| 139 | "sysdeps_unix.cpp", |
| 140 | "sysdeps/posix/network.cpp", |
| 141 | ] |
| 142 | |
| 143 | libadb_test_srcs = [ |
| 144 | "adb_io_test.cpp", |
| 145 | "adb_listeners_test.cpp", |
| 146 | "adb_utils_test.cpp", |
| 147 | "fdevent_test.cpp", |
| 148 | "socket_spec_test.cpp", |
| 149 | "socket_test.cpp", |
| 150 | "sysdeps_test.cpp", |
| 151 | "sysdeps/stat_test.cpp", |
| 152 | "transport_test.cpp", |
Josh Gao | 7c738cd | 2018-04-03 14:37:11 -0700 | [diff] [blame] | 153 | "types_test.cpp", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 154 | ] |
| 155 | |
| 156 | cc_library_host_static { |
| 157 | name: "libadb_host", |
| 158 | defaults: ["adb_defaults"], |
| 159 | |
| 160 | srcs: libadb_srcs + [ |
| 161 | "client/auth.cpp", |
| 162 | "client/usb_libusb.cpp", |
| 163 | "client/usb_dispatch.cpp", |
| 164 | "client/transport_mdns.cpp", |
| 165 | ], |
| 166 | |
Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 167 | generated_headers: ["platform_tools_version"], |
| 168 | |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 169 | target: { |
| 170 | linux: { |
| 171 | srcs: ["client/usb_linux.cpp"], |
| 172 | }, |
| 173 | darwin: { |
| 174 | srcs: ["client/usb_osx.cpp"], |
| 175 | }, |
| 176 | |
| 177 | not_windows: { |
| 178 | srcs: libadb_posix_srcs, |
| 179 | }, |
| 180 | windows: { |
| 181 | enabled: true, |
| 182 | srcs: [ |
| 183 | "client/usb_windows.cpp", |
| 184 | "sysdeps_win32.cpp", |
| 185 | "sysdeps/win32/errno.cpp", |
| 186 | "sysdeps/win32/stat.cpp", |
| 187 | ], |
| 188 | shared_libs: ["AdbWinApi"], |
| 189 | }, |
| 190 | }, |
| 191 | |
| 192 | static_libs: [ |
| 193 | "libbase", |
| 194 | "libcrypto_utils", |
| 195 | "libcrypto", |
| 196 | "libdiagnose_usb", |
| 197 | "libmdnssd", |
| 198 | "libusb", |
Idries Hamadi | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 199 | "libutils", |
| 200 | "liblog", |
| 201 | "libcutils", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 202 | ], |
| 203 | } |
| 204 | |
| 205 | cc_test_host { |
| 206 | name: "adb_test", |
| 207 | defaults: ["adb_defaults"], |
| 208 | srcs: libadb_test_srcs, |
| 209 | static_libs: [ |
| 210 | "libadb_host", |
| 211 | "libbase", |
| 212 | "libcutils", |
| 213 | "libcrypto_utils", |
| 214 | "libcrypto", |
| 215 | "libmdnssd", |
| 216 | "libdiagnose_usb", |
| 217 | "libusb", |
| 218 | ], |
Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 219 | |
| 220 | target: { |
| 221 | windows: { |
| 222 | enabled: true, |
| 223 | shared_libs: ["AdbWinApi"], |
| 224 | }, |
| 225 | }, |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 226 | } |
| 227 | |
Josh Gao | 9c59649 | 2018-04-04 11:27:24 -0700 | [diff] [blame] | 228 | cc_benchmark { |
| 229 | name: "adb_benchmark", |
| 230 | defaults: ["adb_defaults"], |
| 231 | |
| 232 | srcs: ["transport_benchmark.cpp"], |
| 233 | target: { |
| 234 | android: { |
| 235 | static_libs: [ |
| 236 | "libadbd", |
| 237 | ], |
| 238 | }, |
| 239 | host: { |
| 240 | static_libs: [ |
| 241 | "libadb_host", |
| 242 | ], |
| 243 | }, |
| 244 | }, |
| 245 | |
| 246 | static_libs: [ |
| 247 | "libbase", |
| 248 | "libcutils", |
| 249 | "libcrypto_utils", |
| 250 | "libcrypto", |
| 251 | "libdiagnose_usb", |
| 252 | "liblog", |
| 253 | "libusb", |
| 254 | ], |
| 255 | } |
| 256 | |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 257 | cc_binary_host { |
| 258 | name: "adb", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 259 | |
| 260 | defaults: ["adb_defaults"], |
| 261 | |
| 262 | srcs: [ |
| 263 | "client/adb_client.cpp", |
| 264 | "client/bugreport.cpp", |
| 265 | "client/commandline.cpp", |
| 266 | "client/file_sync_client.cpp", |
| 267 | "client/main.cpp", |
| 268 | "client/console.cpp", |
Idries Hamadi | ed409ea | 2018-01-29 16:30:36 +0000 | [diff] [blame] | 269 | "client/adb_install.cpp", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 270 | "client/line_printer.cpp", |
| 271 | "shell_service_protocol.cpp", |
| 272 | ], |
| 273 | |
| 274 | static_libs: [ |
| 275 | "libadb_host", |
| 276 | "libbase", |
| 277 | "libcutils", |
| 278 | "libcrypto_utils", |
| 279 | "libcrypto", |
| 280 | "libdiagnose_usb", |
| 281 | "liblog", |
| 282 | "libmdnssd", |
| 283 | "libusb", |
Idries Hamadi | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 284 | "libutils", |
| 285 | "liblog", |
| 286 | "libcutils", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 287 | ], |
| 288 | |
| 289 | stl: "libc++_static", |
| 290 | |
| 291 | // Don't add anything here, we don't want additional shared dependencies |
| 292 | // on the host adb tool, and shared libraries that link against libc++ |
| 293 | // will violate ODR |
| 294 | shared_libs: [], |
| 295 | |
Idries Hamadi | 7575cd9 | 2018-08-24 11:46:45 +0100 | [diff] [blame] | 296 | required: [ |
| 297 | "deploypatchgenerator", |
| 298 | ], |
| 299 | |
Dan Willemsen | 3f439a7 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 300 | // Archive adb, adb.exe. |
| 301 | dist: { |
| 302 | targets: [ |
| 303 | "dist_files", |
| 304 | "sdk", |
| 305 | "win_sdk", |
| 306 | ], |
| 307 | }, |
| 308 | |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 309 | target: { |
| 310 | darwin: { |
| 311 | cflags: [ |
| 312 | "-Wno-sizeof-pointer-memaccess", |
| 313 | ], |
| 314 | }, |
| 315 | windows: { |
| 316 | enabled: true, |
| 317 | ldflags: ["-municode"], |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 318 | shared_libs: ["AdbWinApi"], |
| 319 | required: [ |
| 320 | "AdbWinUsbApi", |
| 321 | ], |
| 322 | }, |
| 323 | }, |
| 324 | } |
| 325 | |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 326 | // libadbd_core contains the common sources to build libadbd and libadbd_services. |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 327 | cc_library_static { |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 328 | name: "libadbd_core", |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 329 | defaults: ["adbd_defaults", "host_adbd_supported"], |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 330 | recovery_available: true, |
| 331 | |
| 332 | // libminadbd wants both, as it's used to build native tests. |
| 333 | compile_multilib: "both", |
| 334 | |
| 335 | srcs: libadb_srcs + libadb_posix_srcs + [ |
| 336 | "daemon/auth.cpp", |
| 337 | "daemon/jdwp_service.cpp", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 338 | ], |
| 339 | |
| 340 | local_include_dirs: [ |
| 341 | "daemon/include", |
| 342 | ], |
| 343 | |
Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 344 | generated_headers: ["platform_tools_version"], |
| 345 | |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 346 | static_libs: [ |
| 347 | "libdiagnose_usb", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 348 | ], |
| 349 | |
| 350 | shared_libs: [ |
| 351 | "libasyncio", |
| 352 | "libbase", |
| 353 | "libcrypto", |
| 354 | "libcrypto_utils", |
| 355 | "libcutils", |
| 356 | "liblog", |
| 357 | ], |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 358 | |
| 359 | target: { |
| 360 | android: { |
| 361 | whole_static_libs: [ |
| 362 | "libqemu_pipe", |
| 363 | ], |
| 364 | srcs: [ |
| 365 | "daemon/transport_qemu.cpp", |
| 366 | "daemon/usb.cpp", |
| 367 | "daemon/usb_ffs.cpp", |
| 368 | "daemon/usb_legacy.cpp", |
| 369 | ] |
| 370 | }, |
| 371 | linux_glibc: { |
| 372 | srcs: [ |
| 373 | "daemon/usb_dummy.cpp", |
| 374 | ] |
| 375 | } |
| 376 | }, |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | cc_library { |
| 380 | name: "libadbd_services", |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 381 | defaults: ["adbd_defaults", "host_adbd_supported"], |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 382 | recovery_available: true, |
| 383 | compile_multilib: "both", |
| 384 | |
| 385 | srcs: [ |
| 386 | "daemon/file_sync_service.cpp", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 387 | "daemon/services.cpp", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 388 | "daemon/shell_service.cpp", |
| 389 | "shell_service_protocol.cpp", |
| 390 | ], |
| 391 | |
| 392 | cflags: [ |
| 393 | "-D_GNU_SOURCE", |
| 394 | "-Wno-deprecated-declarations", |
| 395 | ], |
| 396 | |
| 397 | static_libs: [ |
| 398 | "libadbd_core", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 399 | "libdiagnose_usb", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 400 | ], |
| 401 | |
| 402 | shared_libs: [ |
| 403 | "libasyncio", |
| 404 | "libbase", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 405 | "libcrypto", |
| 406 | "libcrypto_utils", |
| 407 | "libcutils", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 408 | "liblog", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 409 | ], |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 410 | |
Mark Salyzyn | 2f6c180 | 2019-02-15 07:45:26 -0800 | [diff] [blame] | 411 | product_variables: { |
| 412 | debuggable: { |
| 413 | required: [ |
| 414 | "remount", |
| 415 | ], |
| 416 | }, |
| 417 | }, |
| 418 | |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 419 | target: { |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 420 | android: { |
| 421 | srcs: [ |
| 422 | "daemon/abb_service.cpp", |
| 423 | "daemon/framebuffer_service.cpp", |
| 424 | "daemon/mdns.cpp", |
| 425 | "daemon/reboot_service.cpp", |
| 426 | "daemon/remount_service.cpp", |
| 427 | "daemon/restart_service.cpp", |
| 428 | "daemon/set_verity_enable_state_service.cpp", |
| 429 | ], |
| 430 | static_libs: [ |
| 431 | "libavb_user", |
| 432 | ], |
| 433 | shared_libs: [ |
| 434 | "libbootloader_message", |
| 435 | "libmdnssd", |
| 436 | "libext4_utils", |
| 437 | "libfec", |
| 438 | "libfs_mgr", |
| 439 | "libselinux", |
| 440 | ], |
| 441 | }, |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 442 | recovery: { |
| 443 | exclude_srcs: [ |
| 444 | "daemon/abb_service.cpp", |
| 445 | ], |
| 446 | }, |
| 447 | }, |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | cc_library { |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 451 | name: "libadbd", |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 452 | defaults: ["adbd_defaults", "host_adbd_supported"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 453 | recovery_available: true, |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 454 | |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 455 | // Avoid getting duplicate symbol of android::build::GetBuildNumber(). |
| 456 | use_version_lib: false, |
| 457 | |
| 458 | // libminadbd wants both, as it's used to build native tests. |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 459 | compile_multilib: "both", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 460 | |
| 461 | // libadbd doesn't build any additional source, but to expose libadbd_core as a shared library. |
| 462 | whole_static_libs: [ |
| 463 | "libadbd_core", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 464 | ], |
| 465 | |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 466 | shared_libs: [ |
| 467 | "libadbd_services", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 468 | "libasyncio", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 469 | "libbase", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 470 | "libcrypto", |
| 471 | "libcrypto_utils", |
| 472 | "libcutils", |
| 473 | "liblog", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 474 | ], |
Jerry Zhang | b156c60 | 2018-05-07 15:14:47 -0700 | [diff] [blame] | 475 | |
| 476 | export_include_dirs: [ |
| 477 | "daemon/include", |
| 478 | ], |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 479 | } |
| 480 | |
| 481 | cc_binary { |
| 482 | name: "adbd", |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 483 | defaults: ["adbd_defaults", "host_adbd_supported"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 484 | recovery_available: true, |
Josh Gao | 8db99f8 | 2018-03-06 12:57:27 -0800 | [diff] [blame] | 485 | |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 486 | srcs: [ |
| 487 | "daemon/main.cpp", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 488 | ], |
| 489 | |
| 490 | cflags: [ |
| 491 | "-D_GNU_SOURCE", |
| 492 | "-Wno-deprecated-declarations", |
| 493 | ], |
| 494 | |
| 495 | strip: { |
| 496 | keep_symbols: true, |
| 497 | }, |
| 498 | |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 499 | shared_libs: [ |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 500 | "libadbd", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 501 | "libadbd_services", |
| 502 | "libbase", |
| 503 | "libcap", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 504 | "libcrypto", |
Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 505 | "libcutils", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 506 | "liblog", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 507 | "libminijail", |
| 508 | "libselinux", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 509 | ], |
| 510 | } |
| 511 | |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 512 | cc_binary { |
Josh Gao | bde8c84 | 2019-05-01 18:25:14 -0700 | [diff] [blame] | 513 | name: "static_adbd", |
| 514 | defaults: ["adbd_defaults", "host_adbd_supported"], |
| 515 | |
| 516 | recovery_available: false, |
| 517 | static_executable: true, |
| 518 | host_supported: false, |
| 519 | |
| 520 | srcs: [ |
| 521 | "daemon/main.cpp", |
| 522 | ], |
| 523 | |
| 524 | cflags: [ |
| 525 | "-D_GNU_SOURCE", |
| 526 | "-Wno-deprecated-declarations", |
| 527 | ], |
| 528 | |
| 529 | strip: { |
| 530 | keep_symbols: true, |
| 531 | }, |
| 532 | |
| 533 | static_libs: [ |
| 534 | "libadbd", |
| 535 | "libadbd_services", |
| 536 | "libasyncio", |
| 537 | "libavb_user", |
| 538 | "libbase", |
| 539 | "libbootloader_message", |
| 540 | "libcap", |
| 541 | "libcrypto", |
| 542 | "libcrypto_utils", |
| 543 | "libcutils", |
| 544 | "libdiagnose_usb", |
| 545 | "libext4_utils", |
| 546 | "libfec", |
| 547 | "libfec_rs", |
| 548 | "libfs_mgr", |
| 549 | "liblog", |
| 550 | "liblp", |
| 551 | "libmdnssd", |
| 552 | "libminijail", |
| 553 | "libselinux", |
| 554 | "libsquashfs_utils", |
| 555 | ], |
| 556 | } |
| 557 | |
| 558 | cc_binary { |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 559 | name: "abb", |
| 560 | |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 561 | defaults: ["adbd_defaults"], |
Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 562 | recovery_available: false, |
| 563 | |
| 564 | srcs: [ |
| 565 | "daemon/abb.cpp", |
| 566 | ], |
| 567 | |
| 568 | cflags: [ |
| 569 | "-D_GNU_SOURCE", |
| 570 | "-Wno-deprecated-declarations", |
| 571 | ], |
| 572 | |
| 573 | strip: { |
| 574 | keep_symbols: true, |
| 575 | }, |
| 576 | |
| 577 | static_libs: [ |
| 578 | "libadbd_core", |
| 579 | "libadbd_services", |
| 580 | "libcmd", |
| 581 | ], |
| 582 | |
| 583 | shared_libs: [ |
| 584 | "libbase", |
| 585 | "libbinder", |
| 586 | "liblog", |
| 587 | "libutils", |
| 588 | "libselinux", |
| 589 | ], |
| 590 | } |
| 591 | |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 592 | cc_test { |
| 593 | name: "adbd_test", |
Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 594 | defaults: ["adbd_defaults"], |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 595 | srcs: libadb_test_srcs + [ |
Josh Gao | 997cfac | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 596 | "daemon/services.cpp", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 597 | "daemon/shell_service.cpp", |
| 598 | "daemon/shell_service_test.cpp", |
| 599 | "shell_service_protocol.cpp", |
| 600 | "shell_service_protocol_test.cpp", |
| 601 | ], |
| 602 | |
| 603 | static_libs: [ |
| 604 | "libadbd", |
| 605 | "libbase", |
Josh Gao | 997cfac | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 606 | "libbootloader_message", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 607 | "libcutils", |
| 608 | "libcrypto_utils", |
| 609 | "libcrypto", |
| 610 | "libdiagnose_usb", |
| 611 | "liblog", |
| 612 | "libusb", |
| 613 | "libmdnssd", |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 614 | "libselinux", |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 615 | ], |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 616 | test_suites: ["device-tests"], |
Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 617 | } |
| 618 | |
Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 619 | python_test_host { |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 620 | name: "adb_integration_test_adb", |
| 621 | main: "test_adb.py", |
| 622 | srcs: [ |
| 623 | "test_adb.py", |
| 624 | ], |
Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 625 | test_config: "adb_integration_test_adb.xml", |
| 626 | test_suites: ["general-tests"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 627 | version: { |
| 628 | py2: { |
Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 629 | enabled: false, |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 630 | }, |
| 631 | py3: { |
Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 632 | enabled: true, |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 633 | }, |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 634 | }, |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 635 | } |
| 636 | |
Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 637 | python_test_host { |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 638 | name: "adb_integration_test_device", |
| 639 | main: "test_device.py", |
| 640 | srcs: [ |
| 641 | "test_device.py", |
| 642 | ], |
| 643 | libs: [ |
| 644 | "adb_py", |
| 645 | ], |
Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 646 | test_config: "adb_integration_test_device.xml", |
| 647 | test_suites: ["general-tests"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 648 | version: { |
| 649 | py2: { |
| 650 | enabled: true, |
| 651 | }, |
| 652 | py3: { |
| 653 | enabled: false, |
| 654 | }, |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 655 | }, |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 656 | } |