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