Bob Badour | ef0ee4f | 2021-02-12 15:35:55 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_zstd_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change that took the approach of |
| 6 | // 'apply every license found to every target'. While this makes sure we respect |
| 7 | // every license restriction, it may not be entirely correct. |
| 8 | // |
| 9 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 10 | // |
| 11 | // Please consider splitting the single license below into multiple licenses, |
| 12 | // taking care not to lose any license_kind information, and overriding the |
| 13 | // default license using the 'licenses: [...]' property on targets as needed. |
| 14 | // |
| 15 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 16 | // to attach the license to, and including a comment whether the files may be |
| 17 | // used in the current project. |
| 18 | // |
| 19 | // large-scale-change included anything that looked like it might be a license |
| 20 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 21 | // |
| 22 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "external_zstd_license", |
| 26 | visibility: [":__subpackages__"], |
| 27 | license_kinds: [ |
| 28 | "SPDX-license-identifier-BSD", |
| 29 | "SPDX-license-identifier-CC0-1.0", |
| 30 | "SPDX-license-identifier-GPL", |
| 31 | "SPDX-license-identifier-GPL-2.0", |
| 32 | "SPDX-license-identifier-GPL-3.0", |
| 33 | "SPDX-license-identifier-LGPL", |
| 34 | "SPDX-license-identifier-MIT", |
| 35 | "SPDX-license-identifier-Zlib", |
| 36 | "legacy_unencumbered", |
| 37 | ], |
| 38 | license_text: [ |
| 39 | "COPYING", |
| 40 | "LICENSE", |
| 41 | ], |
| 42 | } |
| 43 | |
DroidFreak32 | e1acbea | 2023-05-06 11:09:08 +0530 | [diff] [blame] | 44 | cc_binary { |
| 45 | name: "zstd", |
| 46 | |
| 47 | cflags: [ |
| 48 | "-DZSTD_GZCOMPRESS", |
| 49 | "-DZSTD_GZDECOMPRESS", |
| 50 | "-DZSTD_LZ4COMPRESS", |
| 51 | "-DZSTD_LZ4DECOMPRESS", |
| 52 | "-DZSTD_MULTITHREAD", |
| 53 | "-Wall", |
| 54 | "-Werror", |
| 55 | ], |
| 56 | |
| 57 | shared_libs: [ |
| 58 | "liblz4", |
| 59 | "libz", |
| 60 | "libzstd", |
| 61 | ], |
| 62 | |
| 63 | srcs: ["programs/*.c"], |
Nolen Johnson | 3b2d535 | 2023-05-15 23:27:38 -0400 | [diff] [blame] | 64 | system_ext_specific: true, |
DroidFreak32 | e1acbea | 2023-05-06 11:09:08 +0530 | [diff] [blame] | 65 | |
| 66 | required: ["zstdgrep", "zstdless"], |
| 67 | |
| 68 | symlinks: [ |
| 69 | "zstdcat", |
| 70 | "zstdmt", |
| 71 | "unzstd", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | sh_binary { |
| 76 | name: "zstdgrep", |
| 77 | src: "programs/zstdgrep", |
Nolen Johnson | 3b2d535 | 2023-05-15 23:27:38 -0400 | [diff] [blame] | 78 | system_ext_specific: true, |
DroidFreak32 | e1acbea | 2023-05-06 11:09:08 +0530 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | sh_binary { |
| 82 | name: "zstdless", |
| 83 | src: "programs/zstdless", |
Nolen Johnson | 3b2d535 | 2023-05-15 23:27:38 -0400 | [diff] [blame] | 84 | system_ext_specific: true, |
DroidFreak32 | e1acbea | 2023-05-06 11:09:08 +0530 | [diff] [blame] | 85 | } |
| 86 | |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 87 | cc_library { |
| 88 | name: "libzstd", |
Jooyung Han | fde68c7 | 2022-06-24 14:56:22 +0900 | [diff] [blame] | 89 | min_sdk_version: "apex_inherit", |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 90 | apex_available: [ |
| 91 | "//apex_available:platform", |
| 92 | "com.android.adbd", |
Christopher Ferris | 73ddd2a | 2023-11-30 17:02:50 -0800 | [diff] [blame] | 93 | "com.android.art", |
| 94 | "com.android.art.debug", |
| 95 | "com.android.runtime", |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 96 | ], |
| 97 | visibility: [ |
| 98 | "//bootable/recovery:__subpackages__", |
Aleksei Vetrov | 1970bec | 2023-11-10 13:23:11 +0000 | [diff] [blame] | 99 | "//device/google/contexthub/util/nanoapp_postprocess:__subpackages__", |
| 100 | "//external/bcc/libbpf-tools:__subpackages__", |
| 101 | "//external/bpftool:__subpackages__", |
| 102 | "//external/dwarves:__subpackages__", |
| 103 | "//external/elfutils:__subpackages__", |
| 104 | "//external/libbpf:__subpackages__", |
Satoshi Niwa | e14df3d | 2021-08-05 12:18:43 +0900 | [diff] [blame] | 105 | "//external/squashfs-tools/squashfs-tools:__subpackages__", |
Aleksei Vetrov | 1970bec | 2023-11-10 13:23:11 +0000 | [diff] [blame] | 106 | "//external/stg:__subpackages__", |
dimitry | 77211fc | 2024-01-30 20:56:15 +0100 | [diff] [blame] | 107 | "//frameworks/libs/binary_translation/tools:__subpackages__", |
Baligh Uddin | 625bf95 | 2020-10-18 15:01:42 +0000 | [diff] [blame] | 108 | "//packages/modules/adb:__subpackages__", |
Baligh Uddin | 5d8ab80 | 2020-10-08 12:26:04 +0000 | [diff] [blame] | 109 | "//system/logging/logd:__subpackages__", |
Kelvin Zhang | fa7a208 | 2023-02-15 16:59:59 -0800 | [diff] [blame] | 110 | "//system/update_engine:__subpackages__", |
| 111 | "//system/core/fs_mgr/libsnapshot:__subpackages__", |
| 112 | "//system/core/init:__subpackages__", |
| 113 | "//system/core/fastboot:__subpackages__", |
David Anderson | bfe4aad | 2023-07-14 09:13:39 -0700 | [diff] [blame] | 114 | "//system/extras/partition_tools:__subpackages__", |
DroidFreak32 | 3f19d52 | 2022-12-18 18:49:57 +0530 | [diff] [blame] | 115 | "//external/rsync:__subpackages__", |
Christopher Ferris | 73ddd2a | 2023-11-30 17:02:50 -0800 | [diff] [blame] | 116 | "//system/unwinding/libunwindstack:__subpackages__", |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 117 | ], |
| 118 | recovery_available: true, |
| 119 | vendor_available: true, |
DroidFreak32 | 3f19d52 | 2022-12-18 18:49:57 +0530 | [diff] [blame] | 120 | product_available: true, |
Nolen Johnson | 3b2d535 | 2023-05-15 23:27:38 -0400 | [diff] [blame] | 121 | system_ext_specific: true, |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 122 | host_supported: true, |
Aleksei Vetrov | 1970bec | 2023-11-10 13:23:11 +0000 | [diff] [blame] | 123 | native_bridge_supported: true, |
Kelvin Zhang | fa7a208 | 2023-02-15 16:59:59 -0800 | [diff] [blame] | 124 | ramdisk_available: true, |
| 125 | vendor_ramdisk_available: true, |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 126 | target: { |
| 127 | windows: { |
| 128 | enabled: true, |
| 129 | }, |
| 130 | }, |
| 131 | srcs: ["lib/*/*.c"], |
Elliott Hughes | 9f10228 | 2022-01-13 12:53:04 -0800 | [diff] [blame] | 132 | arch: { |
| 133 | x86_64: { |
Elliott Hughes | f19a5ce | 2023-09-12 17:42:48 +0000 | [diff] [blame] | 134 | cflags: ["-DZSTD_DISABLE_ASM"], |
Elliott Hughes | 9f10228 | 2022-01-13 12:53:04 -0800 | [diff] [blame] | 135 | }, |
| 136 | }, |
Josh Gao | 739d661 | 2020-05-27 18:51:50 -0700 | [diff] [blame] | 137 | cflags: ["-Wall", "-Werror"], |
| 138 | local_include_dirs: ["lib/common"], |
| 139 | export_include_dirs: ["lib"], |
| 140 | } |
Kris Alder | 8b21ab8 | 2020-10-12 19:56:38 +0000 | [diff] [blame] | 141 | |
| 142 | cc_defaults { |
| 143 | name: "zstd_fuzz_defaults", |
| 144 | static_libs: [ |
| 145 | "libzstd", |
| 146 | ], |
| 147 | srcs: [ |
Elliott Hughes | 44aba64 | 2023-09-12 20:18:59 +0000 | [diff] [blame] | 148 | "contrib/externalSequenceProducer/sequence_producer.c", |
Kris Alder | 8b21ab8 | 2020-10-12 19:56:38 +0000 | [diff] [blame] | 149 | "tests/fuzz/fuzz_data_producer.c", |
| 150 | "tests/fuzz/fuzz_helpers.c", |
| 151 | "tests/fuzz/zstd_helpers.c", |
| 152 | ], |
| 153 | local_include_dirs: [ |
Elliott Hughes | 44aba64 | 2023-09-12 20:18:59 +0000 | [diff] [blame] | 154 | "contrib/externalSequenceProducer", |
Kris Alder | 8b21ab8 | 2020-10-12 19:56:38 +0000 | [diff] [blame] | 155 | "lib/common", |
Elliott Hughes | 44aba64 | 2023-09-12 20:18:59 +0000 | [diff] [blame] | 156 | "lib/compress", |
Kris Alder | 8b21ab8 | 2020-10-12 19:56:38 +0000 | [diff] [blame] | 157 | "lib/dictBuilder", |
| 158 | "tests/fuzz", |
| 159 | ], |
Nolen Johnson | 3b2d535 | 2023-05-15 23:27:38 -0400 | [diff] [blame] | 160 | system_ext_specific: true, |
Kris Alder | 8b21ab8 | 2020-10-12 19:56:38 +0000 | [diff] [blame] | 161 | cflags: [ |
| 162 | "-Wno-error", |
| 163 | "-Wno-pointer-arith", |
| 164 | ], |
| 165 | host_supported: true, |
| 166 | } |
| 167 | |
| 168 | cc_fuzz { |
| 169 | name: "zstd_block_decompress_fuzzer", |
| 170 | defaults: [ |
| 171 | "zstd_fuzz_defaults", |
| 172 | ], |
| 173 | srcs: [ |
| 174 | "tests/fuzz/block_decompress.c", |
| 175 | ], |
| 176 | } |
| 177 | |
| 178 | cc_fuzz { |
| 179 | name: "zstd_block_round_trip_fuzzer", |
| 180 | defaults: [ |
| 181 | "zstd_fuzz_defaults", |
| 182 | ], |
| 183 | srcs: [ |
| 184 | "tests/fuzz/block_round_trip.c", |
| 185 | ], |
| 186 | } |
| 187 | |
| 188 | cc_fuzz { |
| 189 | name: "zstd_dict_decompress_fuzzer", |
| 190 | defaults: [ |
| 191 | "zstd_fuzz_defaults", |
| 192 | ], |
| 193 | srcs: [ |
| 194 | "tests/fuzz/dictionary_decompress.c", |
| 195 | ], |
| 196 | } |
| 197 | |
| 198 | cc_fuzz { |
| 199 | name: "zstd_dict_loader_fuzzer", |
| 200 | defaults: [ |
| 201 | "zstd_fuzz_defaults", |
| 202 | ], |
| 203 | srcs: [ |
| 204 | "tests/fuzz/dictionary_loader.c", |
| 205 | ], |
| 206 | } |
| 207 | |
| 208 | cc_fuzz { |
| 209 | name: "zstd_dict_round_trip_fuzzer", |
| 210 | defaults: [ |
| 211 | "zstd_fuzz_defaults", |
| 212 | ], |
| 213 | srcs: [ |
| 214 | "tests/fuzz/dictionary_round_trip.c", |
| 215 | ], |
| 216 | } |
| 217 | |
| 218 | cc_fuzz { |
| 219 | name: "zstd_dict_stream_round_trip_fuzzer", |
| 220 | defaults: [ |
| 221 | "zstd_fuzz_defaults", |
| 222 | ], |
| 223 | srcs: [ |
| 224 | "tests/fuzz/dictionary_stream_round_trip.c", |
| 225 | ], |
| 226 | } |
| 227 | |
| 228 | cc_fuzz { |
| 229 | name: "zstd_raw_dict_round_trip_fuzzer", |
| 230 | defaults: [ |
| 231 | "zstd_fuzz_defaults", |
| 232 | ], |
| 233 | srcs: [ |
| 234 | "tests/fuzz/raw_dictionary_round_trip.c", |
| 235 | ], |
| 236 | } |
| 237 | |
| 238 | cc_fuzz { |
| 239 | name: "zstd_simple_compress_fuzzer", |
| 240 | defaults: [ |
| 241 | "zstd_fuzz_defaults", |
| 242 | ], |
| 243 | srcs: [ |
| 244 | "tests/fuzz/simple_compress.c", |
| 245 | ], |
| 246 | } |
| 247 | |
| 248 | cc_fuzz { |
| 249 | name: "zstd_simple_decompress_fuzzer", |
| 250 | defaults: [ |
| 251 | "zstd_fuzz_defaults", |
| 252 | ], |
| 253 | srcs: [ |
| 254 | "tests/fuzz/simple_decompress.c", |
| 255 | ], |
| 256 | } |
| 257 | |
| 258 | cc_fuzz { |
| 259 | name: "zstd_simple_round_trip_fuzzer", |
| 260 | defaults: [ |
| 261 | "zstd_fuzz_defaults", |
| 262 | ], |
| 263 | srcs: [ |
| 264 | "tests/fuzz/simple_round_trip.c", |
| 265 | ], |
| 266 | } |
| 267 | |
| 268 | cc_fuzz { |
| 269 | name: "zstd_stream_decompress_fuzzer", |
| 270 | defaults: [ |
| 271 | "zstd_fuzz_defaults", |
| 272 | ], |
| 273 | srcs: [ |
| 274 | "tests/fuzz/stream_decompress.c", |
| 275 | ], |
| 276 | } |
| 277 | |
| 278 | cc_fuzz { |
| 279 | name: "zstd_stream_round_trip_fuzzer", |
| 280 | defaults: [ |
| 281 | "zstd_fuzz_defaults", |
| 282 | ], |
| 283 | srcs: [ |
| 284 | "tests/fuzz/stream_round_trip.c", |
| 285 | ], |
| 286 | } |
| 287 | |
| 288 | cc_fuzz { |
| 289 | name: "zstd_frame_info_fuzzer", |
| 290 | defaults: [ |
| 291 | "zstd_fuzz_defaults", |
| 292 | ], |
| 293 | srcs: [ |
| 294 | "tests/fuzz/zstd_frame_info.c", |
| 295 | ], |
| 296 | } |