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