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", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 54 | "libedify", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 55 | "libotautil", |
| 56 | "libz", |
| 57 | ], |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 58 | |
Pete Bentley | 189d424 | 2019-09-12 19:53:46 +0100 | [diff] [blame] | 59 | shared_libs: [ |
| 60 | "libcrypto", |
| 61 | ], |
| 62 | |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 63 | target: { |
| 64 | darwin: { |
| 65 | enabled: false, |
| 66 | }, |
| 67 | }, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | cc_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 Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 84 | "libedify", |
| 85 | "libotautil", |
| 86 | ], |
Pete Bentley | 189d424 | 2019-09-12 19:53:46 +0100 | [diff] [blame] | 87 | |
| 88 | shared_libs: [ |
| 89 | "libcrypto", |
| 90 | ], |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | cc_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 Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 108 | "libotautil", |
Tao Bao | 71c35b9 | 2019-09-23 08:58:44 -0700 | [diff] [blame] | 109 | |
| 110 | // External dependencies. |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 111 | "libbspatch", |
Tao Bao | 71c35b9 | 2019-09-23 08:58:44 -0700 | [diff] [blame] | 112 | "libbrotli", |
| 113 | "libbz", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 114 | ], |
| 115 | |
| 116 | shared_libs: [ |
| 117 | "libbase", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 118 | "libcrypto", |
| 119 | "liblog", |
| 120 | "libz", |
| 121 | "libziparchive", |
| 122 | ], |
| 123 | } |
| 124 | |
Tianjie Xu | 42d7779 | 2019-06-28 11:04:07 -0700 | [diff] [blame] | 125 | cc_library_host_static { |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 126 | name: "libimgdiff", |
| 127 | |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 128 | 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 | |
| 153 | cc_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 Bao | 4568582 | 2017-10-13 14:54:12 -0700 | [diff] [blame] | 166 | "libotautil", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 167 | "libbsdiff", |
| 168 | "libdivsufsort", |
| 169 | "libdivsufsort64", |
| 170 | "libziparchive", |
| 171 | "libbase", |
| 172 | "libutils", |
| 173 | "liblog", |
Tianjie Xu | 8c28081 | 2017-10-28 22:13:16 -0700 | [diff] [blame] | 174 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 175 | "libbz", |
| 176 | "libz", |
| 177 | ], |
| 178 | } |