2016-07-13 03:45:19 +02:00
|
|
|
//
|
|
|
|
// Copyright (C) 2013 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "libziparchive_flags",
|
|
|
|
cflags: [
|
|
|
|
// ZLIB_CONST turns on const for input buffers, which is pretty standard.
|
|
|
|
"-DZLIB_CONST",
|
|
|
|
"-Werror",
|
|
|
|
"-Wall",
|
2016-12-20 17:13:41 +01:00
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
2016-07-13 03:45:19 +02:00
|
|
|
],
|
|
|
|
cppflags: [
|
|
|
|
"-Wold-style-cast",
|
|
|
|
// Incorrectly warns when C++11 empty brace {} initializer is used.
|
|
|
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489
|
|
|
|
"-Wno-missing-field-initializers",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "libziparchive_defaults",
|
|
|
|
srcs: [
|
|
|
|
"zip_archive.cc",
|
|
|
|
"zip_archive_stream_entry.cc",
|
|
|
|
"zip_writer.cc",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
cflags: ["-mno-ms-bitfields"],
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
],
|
2017-07-06 07:02:54 +02:00
|
|
|
|
|
|
|
export_include_dirs: ["include"],
|
2016-07-13 03:45:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library {
|
|
|
|
name: "libziparchive",
|
|
|
|
host_supported: true,
|
2017-05-29 07:59:04 +02:00
|
|
|
vendor_available: true,
|
2017-08-03 08:51:33 +02:00
|
|
|
vndk: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2017-05-16 22:09:54 +02:00
|
|
|
|
2017-05-29 07:59:04 +02:00
|
|
|
defaults: [
|
|
|
|
"libziparchive_defaults",
|
|
|
|
"libziparchive_flags",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
2017-09-28 01:24:45 +02:00
|
|
|
"libz",
|
2017-05-29 07:59:04 +02:00
|
|
|
],
|
2016-07-13 03:45:19 +02:00
|
|
|
target: {
|
|
|
|
android: {
|
2017-05-29 07:59:04 +02:00
|
|
|
shared_libs: [
|
|
|
|
"libutils",
|
|
|
|
],
|
2016-12-21 06:22:00 +01:00
|
|
|
},
|
|
|
|
host: {
|
|
|
|
static_libs: ["libutils"],
|
2016-07-13 03:45:19 +02:00
|
|
|
},
|
2016-11-29 22:32:55 +01:00
|
|
|
linux_bionic: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2016-07-13 03:45:19 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tests.
|
|
|
|
cc_test {
|
|
|
|
name: "ziparchive-tests",
|
|
|
|
host_supported: true,
|
|
|
|
defaults: ["libziparchive_flags"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"entry_name_utils_test.cc",
|
|
|
|
"zip_archive_test.cc",
|
|
|
|
"zip_writer_test.cc",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libziparchive",
|
|
|
|
"libz",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
host: {
|
|
|
|
cppflags: ["-Wno-unnamed-type-template-args"],
|
|
|
|
},
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2017-05-30 16:14:20 +02:00
|
|
|
|
|
|
|
// Performance benchmarks.
|
|
|
|
cc_benchmark {
|
|
|
|
name: "ziparchive-benchmarks",
|
|
|
|
defaults: ["libziparchive_flags"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"zip_archive_benchmark.cpp",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libziparchive",
|
|
|
|
"libz",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
host: {
|
|
|
|
cppflags: ["-Wno-unnamed-type-template-args"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2017-05-29 07:59:04 +02:00
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "unzip",
|
|
|
|
defaults: ["libziparchive_flags"],
|
|
|
|
srcs: ["unzip.cpp"],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libziparchive",
|
|
|
|
],
|
|
|
|
}
|