Tao Bao | 582b678 | 2017-10-05 09:06:21 -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 | |
| 15 | cc_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 | |
| 30 | cc_library_static { |
| 31 | name: "libapplypatch", |
| 32 | |
Tianjie Xu | e40c80d | 2018-02-03 17:20:56 -0800 | [diff] [blame] | 33 | host_supported: true, |
| 34 | |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 35 | 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", |
| 54 | "libcrypto", |
| 55 | "libedify", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 56 | "libotautil", |
| 57 | "libz", |
| 58 | ], |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 59 | |
| 60 | target: { |
| 61 | darwin: { |
| 62 | enabled: false, |
| 63 | }, |
| 64 | }, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | cc_library_static { |
| 68 | name: "libapplypatch_modes", |
| 69 | |
| 70 | defaults: [ |
| 71 | "applypatch_defaults", |
| 72 | ], |
| 73 | |
| 74 | srcs: [ |
| 75 | "applypatch_modes.cpp", |
| 76 | ], |
| 77 | |
| 78 | static_libs: [ |
| 79 | "libapplypatch", |
| 80 | "libbase", |
| 81 | "libcrypto", |
| 82 | "libedify", |
| 83 | "libotautil", |
| 84 | ], |
| 85 | } |
| 86 | |
| 87 | cc_binary { |
| 88 | name: "applypatch", |
| 89 | |
| 90 | defaults: [ |
| 91 | "applypatch_defaults", |
| 92 | ], |
| 93 | |
| 94 | srcs: [ |
| 95 | "applypatch_main.cpp", |
| 96 | ], |
| 97 | |
| 98 | static_libs: [ |
| 99 | "libapplypatch_modes", |
| 100 | "libapplypatch", |
| 101 | "libedify", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 102 | "libotautil", |
| 103 | "libbspatch", |
| 104 | ], |
| 105 | |
| 106 | shared_libs: [ |
| 107 | "libbase", |
Tianjie Xu | 3d84386 | 2017-11-03 15:52:22 -0700 | [diff] [blame] | 108 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 109 | "libbz", |
| 110 | "libcrypto", |
| 111 | "liblog", |
| 112 | "libz", |
| 113 | "libziparchive", |
| 114 | ], |
| 115 | } |
| 116 | |
Tianjie Xu | 42d7779 | 2019-06-28 11:04:07 -0700 | [diff] [blame] | 117 | cc_library_host_static { |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 118 | name: "libimgdiff", |
| 119 | |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 120 | defaults: [ |
| 121 | "applypatch_defaults", |
| 122 | ], |
| 123 | |
| 124 | srcs: [ |
| 125 | "imgdiff.cpp", |
| 126 | ], |
| 127 | |
| 128 | export_include_dirs: [ |
| 129 | "include", |
| 130 | ], |
| 131 | |
| 132 | static_libs: [ |
| 133 | "libbase", |
| 134 | "libbsdiff", |
| 135 | "libdivsufsort", |
| 136 | "libdivsufsort64", |
| 137 | "liblog", |
| 138 | "libotautil", |
| 139 | "libutils", |
| 140 | "libz", |
| 141 | "libziparchive", |
| 142 | ], |
| 143 | } |
| 144 | |
| 145 | cc_binary_host { |
| 146 | name: "imgdiff", |
| 147 | |
| 148 | srcs: [ |
| 149 | "imgdiff_main.cpp", |
| 150 | ], |
| 151 | |
| 152 | defaults: [ |
| 153 | "applypatch_defaults", |
| 154 | ], |
| 155 | |
| 156 | static_libs: [ |
| 157 | "libimgdiff", |
Tao Bao | 4568582 | 2017-10-13 14:54:12 -0700 | [diff] [blame] | 158 | "libotautil", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 159 | "libbsdiff", |
| 160 | "libdivsufsort", |
| 161 | "libdivsufsort64", |
| 162 | "libziparchive", |
| 163 | "libbase", |
| 164 | "libutils", |
| 165 | "liblog", |
Tianjie Xu | 8c28081 | 2017-10-28 22:13:16 -0700 | [diff] [blame] | 166 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 167 | "libbz", |
| 168 | "libz", |
| 169 | ], |
| 170 | } |
| 171 | |
| 172 | cc_library_static { |
| 173 | name: "libimgpatch", |
| 174 | |
| 175 | // The host module is for recovery_host_test (Linux only). |
| 176 | host_supported: true, |
| 177 | |
| 178 | defaults: [ |
| 179 | "applypatch_defaults", |
| 180 | ], |
| 181 | |
| 182 | srcs: [ |
| 183 | "bspatch.cpp", |
| 184 | "imgpatch.cpp", |
| 185 | ], |
| 186 | |
| 187 | static_libs: [ |
| 188 | "libbase", |
| 189 | "libbspatch", |
| 190 | "libbz", |
| 191 | "libcrypto", |
| 192 | "libedify", |
| 193 | "libotautil", |
| 194 | "libz", |
| 195 | ], |
| 196 | |
| 197 | target: { |
| 198 | darwin: { |
| 199 | enabled: false, |
| 200 | }, |
| 201 | }, |
| 202 | } |