blob: f32b5d59c60236c7caab8d481a55e0f9c9699179 [file] [log] [blame]
Hridya Valsarajudea91b42018-07-17 11:14:01 -07001// 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 Wisnera5ad20a2018-08-24 09:59:50 -050015// 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)
Aaron Wisnerdb511202018-06-26 15:38:35 -050017cc_library_host_static {
18 name: "libfastboot2",
19
20 //host_supported: true,
21
22 compile_multilib: "first",
23 srcs: [
24 "bootimg_utils.cpp",
25 "fs.cpp",
26 "socket.cpp",
27 "tcp.cpp",
28 "udp.cpp",
29 "util.cpp",
30 "fastboot_driver.cpp",
31 ],
32
33 static_libs: [
34 "libziparchive",
35 "libsparse",
36 "libutils",
37 "liblog",
38 "libz",
39 "libdiagnose_usb",
40 "libbase",
41 "libcutils",
42 "libgtest",
43 "libgtest_main",
44 "libbase",
45 "libadb_host"
46 ],
47
48 header_libs: [
49 "bootimg_headers"
50 ],
51
52 export_header_lib_headers: [
53 "bootimg_headers"
54 ],
55
56
57 target: {
58 linux: {
59 srcs: ["usb_linux.cpp"],
60 },
Aaron Wisnera5ad20a2018-08-24 09:59:50 -050061
62 darwin: {
63 srcs: ["usb_osx.cpp"],
64
65 host_ldlibs: [
66 "-framework CoreFoundation",
67 "-framework IOKit",
68 ],
69 },
70
71 windows: {
72 srcs: ["usb_windows.cpp"],
73
74 host_ldlibs: [
75 "-lws2_32",
76 ],
77 },
Aaron Wisnerdb511202018-06-26 15:38:35 -050078 },
79
80 cflags: [
81 "-Wall",
82 "-Wextra",
83 "-Werror",
84 "-Wunreachable-code",
85 ],
86
87 export_include_dirs: ["."],
88
89}
Hridya Valsarajudea91b42018-07-17 11:14:01 -070090
91cc_defaults {
92 name: "fastboot_defaults",
93
94 cflags: [
95 "-Wall",
96 "-Wextra",
97 "-Werror",
98 "-Wvla",
99 ],
100 rtti: true,
101
102 clang_cflags: [
103 "-Wthread-safety",
104 ],
105}
106
107cc_binary {
108 name: "fastbootd",
109 defaults: ["fastboot_defaults"],
110
111 recovery: true,
112
113 srcs: [
114 "device/commands.cpp",
115 "device/fastboot_device.cpp",
David Anderson12211d12018-07-24 15:21:20 -0700116 "device/flashing.cpp",
Hridya Valsarajudea91b42018-07-17 11:14:01 -0700117 "device/main.cpp",
118 "device/usb_client.cpp",
Hridya Valsaraju31d2c262018-07-20 13:35:50 -0700119 "device/utility.cpp",
120 "device/variables.cpp",
Hridya Valsarajudea91b42018-07-17 11:14:01 -0700121 ],
122
123 shared_libs: [
Hridya Valsaraju31d2c262018-07-20 13:35:50 -0700124 "android.hardware.boot@1.0",
Hridya Valsarajudea91b42018-07-17 11:14:01 -0700125 "libadbd",
Tao Baob71eedf2018-08-06 19:13:38 -0700126 "libasyncio",
127 "libbase",
128 "libbootloader_message",
129 "libcutils",
David Anderson0d4277d2018-07-31 13:27:37 -0700130 "libext2_uuid",
Tao Baob71eedf2018-08-06 19:13:38 -0700131 "libext4_utils",
132 "libfs_mgr",
133 "libhidlbase",
134 "libhidltransport",
135 "libhwbinder",
136 "liblog",
David Anderson88ef0b12018-08-09 10:40:00 -0700137 "liblp",
Tao Baob71eedf2018-08-06 19:13:38 -0700138 "libsparse",
139 "libutils",
Hridya Valsarajudea91b42018-07-17 11:14:01 -0700140 ],
141
142 cpp_std: "c++17",
143}