| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 1 | // Copyright (C) 2018 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 |  | 
| Aaron Wisner | a5ad20a | 2018-08-24 09:59:50 -0500 | [diff] [blame] | 15 | // This is required because no Android.bp can include a library defined in an | 
|  | 16 | // Android.mk. Eventually should kill libfastboot (defined in Android.mk) | 
| Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 17 | package { | 
| Hridya Valsaraju | 9937379 | 2022-01-18 13:58:46 -0800 | [diff] [blame] | 18 | default_applicable_licenses: [ | 
|  | 19 | "system_core_fastboot_license", | 
|  | 20 | "Android-Apache-2.0", | 
|  | 21 | ], | 
| Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 22 | } | 
|  | 23 |  | 
|  | 24 | // Added automatically by a large-scale-change that took the approach of | 
|  | 25 | // 'apply every license found to every target'. While this makes sure we respect | 
|  | 26 | // every license restriction, it may not be entirely correct. | 
|  | 27 | // | 
|  | 28 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. | 
|  | 29 | // | 
|  | 30 | // Please consider splitting the single license below into multiple licenses, | 
|  | 31 | // taking care not to lose any license_kind information, and overriding the | 
|  | 32 | // default license using the 'licenses: [...]' property on targets as needed. | 
|  | 33 | // | 
|  | 34 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" | 
|  | 35 | // to attach the license to, and including a comment whether the files may be | 
|  | 36 | // used in the current project. | 
|  | 37 | // See: http://go/android-license-faq | 
|  | 38 | license { | 
|  | 39 | name: "system_core_fastboot_license", | 
|  | 40 | visibility: [":__subpackages__"], | 
|  | 41 | license_kinds: [ | 
| Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 42 | "SPDX-license-identifier-BSD", | 
|  | 43 | ], | 
| Hridya Valsaraju | 9937379 | 2022-01-18 13:58:46 -0800 | [diff] [blame] | 44 | license_text: ["LICENSE"], | 
| Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 45 | } | 
|  | 46 |  | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 47 | cc_library_host_static { | 
|  | 48 | name: "libfastboot2", | 
|  | 49 |  | 
|  | 50 | //host_supported: true, | 
|  | 51 |  | 
|  | 52 | compile_multilib: "first", | 
|  | 53 | srcs: [ | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 54 | "bootimg_utils.cpp", | 
|  | 55 | "fs.cpp", | 
|  | 56 | "socket.cpp", | 
|  | 57 | "tcp.cpp", | 
|  | 58 | "udp.cpp", | 
|  | 59 | "util.cpp", | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 60 | "vendor_boot_img_utils.cpp", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 61 | "fastboot_driver.cpp", | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 62 | ], | 
|  | 63 |  | 
|  | 64 | static_libs: [ | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 65 | "libziparchive", | 
|  | 66 | "libsparse", | 
|  | 67 | "libutils", | 
|  | 68 | "liblog", | 
|  | 69 | "libz", | 
|  | 70 | "libdiagnose_usb", | 
|  | 71 | "libbase", | 
|  | 72 | "libcutils", | 
|  | 73 | "libgtest", | 
|  | 74 | "libgtest_main", | 
|  | 75 | "libbase", | 
|  | 76 | "libadb_host", | 
| David Anderson | 8956964 | 2018-11-16 15:53:35 -0800 | [diff] [blame] | 77 | "liblp", | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 78 | ], | 
|  | 79 |  | 
|  | 80 | header_libs: [ | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 81 | "avb_headers", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 82 | "bootimg_headers", | 
| Yifan Hong | 17d469b | 2021-02-18 15:15:46 -0800 | [diff] [blame] | 83 | "libstorage_literals_headers", | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 84 | ], | 
|  | 85 |  | 
|  | 86 | export_header_lib_headers: [ | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 87 | "bootimg_headers", | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 88 | ], | 
|  | 89 |  | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 90 | target: { | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 91 | linux: { | 
|  | 92 | srcs: ["usb_linux.cpp"], | 
|  | 93 | }, | 
| Aaron Wisner | a5ad20a | 2018-08-24 09:59:50 -0500 | [diff] [blame] | 94 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 95 | darwin: { | 
|  | 96 | srcs: ["usb_osx.cpp"], | 
| Aaron Wisner | a5ad20a | 2018-08-24 09:59:50 -0500 | [diff] [blame] | 97 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 98 | host_ldlibs: [ | 
|  | 99 | "-framework CoreFoundation", | 
|  | 100 | "-framework IOKit", | 
|  | 101 | ], | 
|  | 102 | }, | 
| Aaron Wisner | a5ad20a | 2018-08-24 09:59:50 -0500 | [diff] [blame] | 103 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 104 | windows: { | 
|  | 105 | srcs: ["usb_windows.cpp"], | 
| Aaron Wisner | a5ad20a | 2018-08-24 09:59:50 -0500 | [diff] [blame] | 106 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 107 | host_ldlibs: [ | 
|  | 108 | "-lws2_32", | 
|  | 109 | ], | 
|  | 110 | }, | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 111 | }, | 
|  | 112 |  | 
|  | 113 | cflags: [ | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 114 | "-Wall", | 
|  | 115 | "-Wextra", | 
|  | 116 | "-Werror", | 
|  | 117 | "-Wunreachable-code", | 
| Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 118 | ], | 
|  | 119 |  | 
|  | 120 | export_include_dirs: ["."], | 
|  | 121 |  | 
|  | 122 | } | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 123 |  | 
|  | 124 | cc_defaults { | 
|  | 125 | name: "fastboot_defaults", | 
|  | 126 |  | 
|  | 127 | cflags: [ | 
|  | 128 | "-Wall", | 
|  | 129 | "-Wextra", | 
|  | 130 | "-Werror", | 
|  | 131 | "-Wvla", | 
| Yifan Hong | 07e947f | 2021-03-22 19:21:34 -0700 | [diff] [blame] | 132 | "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", | 
| Alix | 9640339 | 2022-04-21 03:03:27 +0000 | [diff] [blame] | 133 | "-Wthread-safety", | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 134 | ], | 
|  | 135 | rtti: true, | 
|  | 136 |  | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 137 | } | 
|  | 138 |  | 
|  | 139 | cc_binary { | 
|  | 140 | name: "fastbootd", | 
|  | 141 | defaults: ["fastboot_defaults"], | 
|  | 142 |  | 
|  | 143 | recovery: true, | 
|  | 144 |  | 
| Yifan Hong | b299cb7 | 2021-02-17 13:44:49 -0800 | [diff] [blame] | 145 | product_variables: { | 
|  | 146 | debuggable: { | 
|  | 147 | cppflags: ["-DFB_ENABLE_FETCH"], | 
|  | 148 | }, | 
|  | 149 | }, | 
|  | 150 |  | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 151 | srcs: [ | 
|  | 152 | "device/commands.cpp", | 
|  | 153 | "device/fastboot_device.cpp", | 
| David Anderson | 12211d1 | 2018-07-24 15:21:20 -0700 | [diff] [blame] | 154 | "device/flashing.cpp", | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 155 | "device/main.cpp", | 
| Josh Gao | 0871824 | 2020-03-27 18:09:56 -0700 | [diff] [blame] | 156 | "device/usb.cpp", | 
| Kelvin Zhang | 682e5b5 | 2022-07-12 17:37:54 -0700 | [diff] [blame] | 157 | "device/usb_iouring.cpp", | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 158 | "device/usb_client.cpp", | 
| Hongguang Chen | 1e23928 | 2020-04-22 14:25:45 -0700 | [diff] [blame] | 159 | "device/tcp_client.cpp", | 
| Hridya Valsaraju | 31d2c26 | 2018-07-20 13:35:50 -0700 | [diff] [blame] | 160 | "device/utility.cpp", | 
|  | 161 | "device/variables.cpp", | 
| Hongguang Chen | 1e23928 | 2020-04-22 14:25:45 -0700 | [diff] [blame] | 162 | "socket.cpp", | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 163 | ], | 
|  | 164 |  | 
|  | 165 | shared_libs: [ | 
| Hridya Valsaraju | 31d2c26 | 2018-07-20 13:35:50 -0700 | [diff] [blame] | 166 | "android.hardware.boot@1.0", | 
| David Anderson | ab8f466 | 2019-10-21 16:45:59 -0700 | [diff] [blame] | 167 | "android.hardware.boot@1.1", | 
| Kelvin Zhang | 6befe78 | 2022-06-21 14:20:54 -0700 | [diff] [blame] | 168 | "android.hardware.boot-V1-ndk", | 
|  | 169 | "libboot_control_client", | 
| josephjang | 2906975 | 2020-09-23 16:28:03 +0800 | [diff] [blame] | 170 | "android.hardware.fastboot@1.1", | 
| Hridya Valsaraju | 47658ca | 2018-09-28 11:41:22 -0700 | [diff] [blame] | 171 | "android.hardware.health@2.0", | 
| Yifan Hong | 4cb88dc | 2021-12-02 18:58:02 -0800 | [diff] [blame] | 172 | "android.hardware.health-V1-ndk", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 173 | "libasyncio", | 
|  | 174 | "libbase", | 
| Yifan Hong | 4cb88dc | 2021-12-02 18:58:02 -0800 | [diff] [blame] | 175 | "libbinder_ndk", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 176 | "libbootloader_message", | 
|  | 177 | "libcutils", | 
| David Anderson | 0d4277d | 2018-07-31 13:27:37 -0700 | [diff] [blame] | 178 | "libext2_uuid", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 179 | "libext4_utils", | 
|  | 180 | "libfs_mgr", | 
| David Anderson | 1d504e3 | 2019-01-15 14:38:20 -0800 | [diff] [blame] | 181 | "libgsi", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 182 | "libhidlbase", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 183 | "liblog", | 
| David Anderson | 88ef0b1 | 2018-08-09 10:40:00 -0700 | [diff] [blame] | 184 | "liblp", | 
| David Anderson | 220ddb1 | 2019-10-31 18:02:41 -0700 | [diff] [blame] | 185 | "libprotobuf-cpp-lite", | 
| Tao Bao | b71eedf | 2018-08-06 19:13:38 -0700 | [diff] [blame] | 186 | "libsparse", | 
|  | 187 | "libutils", | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 188 | ], | 
|  | 189 |  | 
| Hridya Valsaraju | 47658ca | 2018-09-28 11:41:22 -0700 | [diff] [blame] | 190 | static_libs: [ | 
| Yifan Hong | 4cb88dc | 2021-12-02 18:58:02 -0800 | [diff] [blame] | 191 | "android.hardware.health-translate-ndk", | 
| David Anderson | 0b903f9 | 2021-04-07 21:43:03 -0700 | [diff] [blame] | 192 | "libc++fs", | 
| Hridya Valsaraju | 47658ca | 2018-09-28 11:41:22 -0700 | [diff] [blame] | 193 | "libhealthhalutils", | 
| Yifan Hong | 4cb88dc | 2021-12-02 18:58:02 -0800 | [diff] [blame] | 194 | "libhealthshim", | 
| David Anderson | aca0bea | 2020-09-21 16:34:25 -0700 | [diff] [blame] | 195 | "libsnapshot_cow", | 
| Kelvin Zhang | 5cb1b02 | 2022-04-11 17:29:27 -0700 | [diff] [blame] | 196 | "liblz4", | 
| David Anderson | 220ddb1 | 2019-10-31 18:02:41 -0700 | [diff] [blame] | 197 | "libsnapshot_nobinder", | 
| Yifan Hong | 66f0115 | 2020-04-16 11:05:16 -0700 | [diff] [blame] | 198 | "update_metadata-protos", | 
| Kelvin Zhang | 682e5b5 | 2022-07-12 17:37:54 -0700 | [diff] [blame] | 199 | "liburing", | 
| Hridya Valsaraju | 47658ca | 2018-09-28 11:41:22 -0700 | [diff] [blame] | 200 | ], | 
| Kelvin Zhang | 682e5b5 | 2022-07-12 17:37:54 -0700 | [diff] [blame] | 201 | include_dirs: ["bionic/libc/kernel"], | 
| Yifan Hong | 0e13bba | 2019-08-29 16:29:22 -0700 | [diff] [blame] | 202 |  | 
|  | 203 | header_libs: [ | 
| Steve Muckle | a9b3443 | 2020-05-12 16:21:41 -0700 | [diff] [blame] | 204 | "avb_headers", | 
| Elliott Hughes | 02a8324 | 2021-04-20 15:22:02 -0700 | [diff] [blame] | 205 | "libgtest_prod_headers", | 
| Yifan Hong | 0e13bba | 2019-08-29 16:29:22 -0700 | [diff] [blame] | 206 | "libsnapshot_headers", | 
| Yifan Hong | a4eb475 | 2021-02-16 19:37:21 -0800 | [diff] [blame] | 207 | "libstorage_literals_headers", | 
|  | 208 | ], | 
| Hridya Valsaraju | dea91b4 | 2018-07-17 11:14:01 -0700 | [diff] [blame] | 209 | } | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 210 |  | 
|  | 211 | cc_defaults { | 
|  | 212 | name: "fastboot_host_defaults", | 
|  | 213 |  | 
|  | 214 | use_version_lib: true, | 
|  | 215 |  | 
|  | 216 | cflags: [ | 
|  | 217 | "-Wall", | 
|  | 218 | "-Wextra", | 
|  | 219 | "-Werror", | 
|  | 220 | "-Wunreachable-code", | 
| Yifan Hong | 58532df | 2021-03-22 16:39:13 -0700 | [diff] [blame] | 221 | "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", | 
| Alix | 9640339 | 2022-04-21 03:03:27 +0000 | [diff] [blame] | 222 | "-D_FILE_OFFSET_BITS=64", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 223 | ], | 
|  | 224 |  | 
|  | 225 | target: { | 
|  | 226 | darwin: { | 
|  | 227 | cflags: ["-Wno-unused-parameter"], | 
|  | 228 | host_ldlibs: [ | 
|  | 229 | "-lpthread", | 
|  | 230 | "-framework CoreFoundation", | 
|  | 231 | "-framework IOKit", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 232 | ], | 
|  | 233 | }, | 
|  | 234 | windows: { | 
|  | 235 | enabled: true, | 
|  | 236 |  | 
|  | 237 | host_ldlibs: ["-lws2_32"], | 
|  | 238 | }, | 
| David Anderson | 8956964 | 2018-11-16 15:53:35 -0800 | [diff] [blame] | 239 | not_windows: { | 
|  | 240 | static_libs: [ | 
|  | 241 | "libext4_utils", | 
|  | 242 | ], | 
|  | 243 | }, | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 244 | }, | 
|  | 245 |  | 
|  | 246 | stl: "libc++_static", | 
|  | 247 |  | 
|  | 248 | // Don't add anything here, we don't want additional shared dependencies | 
|  | 249 | // on the host fastboot tool, and shared libraries that link against libc++ | 
|  | 250 | // will violate ODR. | 
|  | 251 | shared_libs: [], | 
|  | 252 |  | 
| Chin-Ting Kuo | df6a780 | 2019-09-16 11:23:55 +0800 | [diff] [blame] | 253 | header_libs: [ | 
|  | 254 | "avb_headers", | 
|  | 255 | "bootimg_headers", | 
|  | 256 | ], | 
|  | 257 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 258 | static_libs: [ | 
|  | 259 | "libziparchive", | 
|  | 260 | "libsparse", | 
|  | 261 | "libutils", | 
|  | 262 | "liblog", | 
| Kelvin Zhang | 5cb1b02 | 2022-04-11 17:29:27 -0700 | [diff] [blame] | 263 | "liblz4", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 264 | "libz", | 
|  | 265 | "libdiagnose_usb", | 
|  | 266 | "libbase", | 
|  | 267 | "libcutils", | 
|  | 268 | "libgtest_host", | 
| David Anderson | 8956964 | 2018-11-16 15:53:35 -0800 | [diff] [blame] | 269 | "liblp", | 
|  | 270 | "libcrypto", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 271 | ], | 
|  | 272 | } | 
|  | 273 |  | 
|  | 274 | // | 
|  | 275 | // Build host libfastboot. | 
|  | 276 | // | 
|  | 277 |  | 
|  | 278 | cc_library_host_static { | 
|  | 279 | name: "libfastboot", | 
|  | 280 | defaults: ["fastboot_host_defaults"], | 
|  | 281 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 282 | srcs: [ | 
|  | 283 | "bootimg_utils.cpp", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 284 | "fastboot.cpp", | 
|  | 285 | "fs.cpp", | 
|  | 286 | "socket.cpp", | 
|  | 287 | "tcp.cpp", | 
|  | 288 | "udp.cpp", | 
|  | 289 | "util.cpp", | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 290 | "vendor_boot_img_utils.cpp", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 291 | "fastboot_driver.cpp", | 
|  | 292 | ], | 
|  | 293 |  | 
|  | 294 | // Only version the final binaries | 
|  | 295 | use_version_lib: false, | 
|  | 296 | static_libs: ["libbuildversion"], | 
| Yifan Hong | 17d469b | 2021-02-18 15:15:46 -0800 | [diff] [blame] | 297 | header_libs: [ | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 298 | "avb_headers", | 
| Yifan Hong | 17d469b | 2021-02-18 15:15:46 -0800 | [diff] [blame] | 299 | "libstorage_literals_headers", | 
|  | 300 | ], | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 301 |  | 
|  | 302 | generated_headers: ["platform_tools_version"], | 
|  | 303 |  | 
| Chih-Hung Hsieh | 84006f5 | 2021-02-19 18:30:29 -0800 | [diff] [blame] | 304 | tidy_flags: [ | 
|  | 305 | // DO NOT add quotes around header-filter flag regex argument, | 
|  | 306 | // because build/soong will add quotes around the whole flag. | 
|  | 307 | "-header-filter=(system/core/fastboot/|development/host/windows/usb/api/)", | 
|  | 308 | ], | 
|  | 309 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 310 | target: { | 
|  | 311 | windows: { | 
|  | 312 | srcs: ["usb_windows.cpp"], | 
|  | 313 |  | 
|  | 314 | include_dirs: ["development/host/windows/usb/api"], | 
|  | 315 | }, | 
|  | 316 | darwin: { | 
|  | 317 | srcs: ["usb_osx.cpp"], | 
|  | 318 | }, | 
| Jiyong Park | fd89028 | 2020-08-20 18:04:01 +0900 | [diff] [blame] | 319 | linux: { | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 320 | srcs: ["usb_linux.cpp"], | 
|  | 321 | }, | 
|  | 322 | }, | 
|  | 323 | } | 
|  | 324 |  | 
|  | 325 | // | 
|  | 326 | // Build host fastboot / fastboot.exe | 
|  | 327 | // | 
|  | 328 |  | 
|  | 329 | cc_binary_host { | 
|  | 330 | name: "fastboot", | 
|  | 331 | defaults: ["fastboot_host_defaults"], | 
|  | 332 |  | 
|  | 333 | srcs: ["main.cpp"], | 
|  | 334 | static_libs: ["libfastboot"], | 
|  | 335 |  | 
|  | 336 | required: [ | 
|  | 337 | "mke2fs", | 
|  | 338 | "make_f2fs", | 
| Jaegeuk Kim | a389610 | 2020-07-17 20:30:41 -0700 | [diff] [blame] | 339 | "make_f2fs_casefold", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 340 | ], | 
| Dan Willemsen | 3f439a7 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 341 | dist: { | 
|  | 342 | targets: [ | 
|  | 343 | "dist_files", | 
|  | 344 | "sdk", | 
| Shaju Mathew | 6c27f23 | 2022-10-06 22:12:10 +0000 | [diff] [blame] | 345 | "sdk-repo-platform-tools", | 
|  | 346 | "sdk_repo", | 
| Dan Willemsen | 3f439a7 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 347 | "win_sdk", | 
|  | 348 | ], | 
|  | 349 | }, | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 350 |  | 
|  | 351 | target: { | 
|  | 352 | not_windows: { | 
|  | 353 | required: [ | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 354 | "mke2fs.conf", | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 355 | ], | 
|  | 356 | }, | 
|  | 357 | windows: { | 
|  | 358 | required: ["AdbWinUsbApi"], | 
|  | 359 | shared_libs: ["AdbWinApi"], | 
|  | 360 | }, | 
|  | 361 | }, | 
|  | 362 | } | 
|  | 363 |  | 
|  | 364 | // | 
|  | 365 | // Build host fastboot_test. | 
|  | 366 | // | 
|  | 367 |  | 
|  | 368 | cc_test_host { | 
|  | 369 | name: "fastboot_test", | 
|  | 370 | defaults: ["fastboot_host_defaults"], | 
|  | 371 |  | 
|  | 372 | srcs: [ | 
|  | 373 | "fastboot_test.cpp", | 
|  | 374 | "socket_mock.cpp", | 
|  | 375 | "socket_test.cpp", | 
|  | 376 | "tcp_test.cpp", | 
|  | 377 | "udp_test.cpp", | 
|  | 378 | ], | 
|  | 379 |  | 
|  | 380 | static_libs: ["libfastboot"], | 
|  | 381 |  | 
|  | 382 | target: { | 
|  | 383 | windows: { | 
|  | 384 | shared_libs: ["AdbWinApi"], | 
|  | 385 | }, | 
|  | 386 | windows_x86_64: { | 
|  | 387 | // Avoid trying to build for win64 | 
|  | 388 | enabled: false, | 
|  | 389 | }, | 
|  | 390 | }, | 
|  | 391 | } | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 392 |  | 
|  | 393 | cc_test_host { | 
|  | 394 | name: "fastboot_vendor_boot_img_utils_test", | 
|  | 395 | srcs: ["vendor_boot_img_utils_test.cpp"], | 
|  | 396 | static_libs: [ | 
|  | 397 | "libbase", | 
|  | 398 | "libc++fs", | 
|  | 399 | "libfastboot", | 
|  | 400 | "libgmock", | 
|  | 401 | "liblog", | 
|  | 402 | ], | 
|  | 403 | header_libs: [ | 
|  | 404 | "avb_headers", | 
|  | 405 | "bootimg_headers", | 
|  | 406 | ], | 
|  | 407 | cflags: [ | 
|  | 408 | "-Wall", | 
|  | 409 | "-Werror", | 
|  | 410 | ], | 
|  | 411 | data: [ | 
|  | 412 | ":fastboot_test_dtb", | 
|  | 413 | ":fastboot_test_bootconfig", | 
|  | 414 | ":fastboot_test_vendor_ramdisk_none", | 
|  | 415 | ":fastboot_test_vendor_ramdisk_platform", | 
|  | 416 | ":fastboot_test_vendor_ramdisk_replace", | 
|  | 417 | ":fastboot_test_vendor_boot_v3", | 
|  | 418 | ":fastboot_test_vendor_boot_v4_without_frag", | 
| Alix | 9640339 | 2022-04-21 03:03:27 +0000 | [diff] [blame] | 419 | ":fastboot_test_vendor_boot_v4_with_frag", | 
| Yifan Hong | e71fe24 | 2021-02-22 15:00:15 -0800 | [diff] [blame] | 420 | ], | 
|  | 421 | } | 
| Ayushi Khopkar | ce5c033 | 2021-09-20 12:00:21 +0530 | [diff] [blame] | 422 |  | 
|  | 423 | cc_library_headers { | 
|  | 424 | name: "fastboot_headers", | 
|  | 425 | host_supported: true, | 
|  | 426 | export_include_dirs: ["."], | 
|  | 427 | } |