blob: 55d185201171e395866a98be797dbc1e95323560 [file] [log] [blame]
Tao Bao582b6782017-10-05 09:06:21 -07001// 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
15cc_defaults {
16 name: "applypatch_defaults",
17
18 cflags: [
19 "-D_FILE_OFFSET_BITS=64",
20 "-DZLIB_CONST",
21 "-Wall",
22 "-Werror",
23 ],
24
25 local_include_dirs: [
26 "include",
27 ],
28}
29
30cc_library_static {
31 name: "libapplypatch",
32
Tianjie Xue40c80d2018-02-03 17:20:56 -080033 host_supported: true,
34
Tao Bao582b6782017-10-05 09:06:21 -070035 defaults: [
36 "applypatch_defaults",
37 ],
38
39 srcs: [
40 "applypatch.cpp",
41 "bspatch.cpp",
42 "freecache.cpp",
43 "imgpatch.cpp",
44 ],
45
46 export_include_dirs: [
47 "include",
48 ],
49
50 static_libs: [
51 "libbase",
52 "libbspatch",
53 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -070054 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -070055 "libotautil",
56 "libz",
57 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080058
Pete Bentley189d4242019-09-12 19:53:46 +010059 shared_libs: [
60 "libcrypto",
61 ],
62
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080063 target: {
64 darwin: {
65 enabled: false,
66 },
67 },
Tao Bao582b6782017-10-05 09:06:21 -070068}
69
70cc_library_static {
71 name: "libapplypatch_modes",
72
73 defaults: [
74 "applypatch_defaults",
75 ],
76
77 srcs: [
78 "applypatch_modes.cpp",
79 ],
80
81 static_libs: [
82 "libapplypatch",
83 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -070084 "libedify",
85 "libotautil",
86 ],
Pete Bentley189d4242019-09-12 19:53:46 +010087
88 shared_libs: [
89 "libcrypto",
90 ],
Tao Bao582b6782017-10-05 09:06:21 -070091}
92
93cc_binary {
94 name: "applypatch",
95
96 defaults: [
97 "applypatch_defaults",
98 ],
99
100 srcs: [
101 "applypatch_main.cpp",
102 ],
103
104 static_libs: [
105 "libapplypatch_modes",
106 "libapplypatch",
107 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -0700108 "libotautil",
Tao Bao71c35b92019-09-23 08:58:44 -0700109
110 // External dependencies.
Tao Bao582b6782017-10-05 09:06:21 -0700111 "libbspatch",
Tao Bao71c35b92019-09-23 08:58:44 -0700112 "libbrotli",
113 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -0700114 ],
115
116 shared_libs: [
117 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700118 "libcrypto",
119 "liblog",
120 "libz",
121 "libziparchive",
122 ],
123}
124
Tianjie Xu42d77792019-06-28 11:04:07 -0700125cc_library_host_static {
Tao Bao582b6782017-10-05 09:06:21 -0700126 name: "libimgdiff",
127
Tao Bao582b6782017-10-05 09:06:21 -0700128 defaults: [
129 "applypatch_defaults",
130 ],
131
132 srcs: [
133 "imgdiff.cpp",
134 ],
135
136 export_include_dirs: [
137 "include",
138 ],
139
140 static_libs: [
141 "libbase",
142 "libbsdiff",
143 "libdivsufsort",
144 "libdivsufsort64",
145 "liblog",
146 "libotautil",
147 "libutils",
148 "libz",
149 "libziparchive",
150 ],
151}
152
153cc_binary_host {
154 name: "imgdiff",
155
156 srcs: [
157 "imgdiff_main.cpp",
158 ],
159
160 defaults: [
161 "applypatch_defaults",
162 ],
163
164 static_libs: [
165 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700166 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700167 "libbsdiff",
168 "libdivsufsort",
169 "libdivsufsort64",
170 "libziparchive",
171 "libbase",
172 "libutils",
173 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700174 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700175 "libbz",
176 "libz",
177 ],
178}