diff options
author | Colin Cross <ccross@android.com> | 2016-07-12 23:43:18 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-07-12 23:53:04 -0700 |
commit | 2fedbf79bb29960a4d3a9b632f75f13f876164c9 (patch) | |
tree | 634edbcc2f5ad193f714bb2f9a4cefae13206392 /libziparchive | |
parent | 4e8bb3e67762c78858846330df5f6ccd80feae21 (diff) | |
parent | 41e82a3ca506857bd54d998b4f5e13910f09f250 (diff) | |
download | system_core-2fedbf79bb29960a4d3a9b632f75f13f876164c9.tar.gz system_core-2fedbf79bb29960a4d3a9b632f75f13f876164c9.tar.bz2 system_core-2fedbf79bb29960a4d3a9b632f75f13f876164c9.zip |
resolve merge conflicts of 41e82a3 to stage-aosp-master
Change-Id: I5a7faca3249f0c038914540b1dd29edf0084c0e1
Diffstat (limited to 'libziparchive')
-rw-r--r-- | libziparchive/Android.bp | 111 | ||||
-rw-r--r-- | libziparchive/Android.mk | 106 |
2 files changed, 111 insertions, 106 deletions
diff --git a/libziparchive/Android.bp b/libziparchive/Android.bp new file mode 100644 index 000000000..5ed0fe853 --- /dev/null +++ b/libziparchive/Android.bp @@ -0,0 +1,111 @@ +// +// 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", + ], + 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", + ], +} + + +cc_library { + name: "libziparchive", + host_supported: true, + defaults: ["libziparchive_defaults", "libziparchive_flags"], + static_libs: ["libutils"], + shared_libs: ["liblog", "libbase"], + target: { + android: { + static_libs: ["libz"], + }, + host: { + shared_libs: ["libz-host"], + }, + }, +} + +// Also provide libziparchive-host until everything is switched over to using libziparchive +cc_library { + name: "libziparchive-host", + host_supported: true, + device_supported: false, + defaults: ["libziparchive_defaults", "libziparchive_flags"], + shared_libs: ["libz-host"], + static_libs: ["libutils"], +} + +// 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, + }, + }, +} diff --git a/libziparchive/Android.mk b/libziparchive/Android.mk deleted file mode 100644 index 3cd8b87b1..000000000 --- a/libziparchive/Android.mk +++ /dev/null @@ -1,106 +0,0 @@ -# -# 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. - -LOCAL_PATH := $(call my-dir) - -libziparchive_source_files := \ - zip_archive.cc \ - zip_archive_stream_entry.cc \ - zip_writer.cc \ - -libziparchive_test_files := \ - entry_name_utils_test.cc \ - zip_archive_test.cc \ - zip_writer_test.cc \ - -# ZLIB_CONST turns on const for input buffers, which is pretty standard. -libziparchive_common_c_flags := \ - -DZLIB_CONST \ - -Werror \ - -Wall \ - -# Incorrectly warns when C++11 empty brace {} initializer is used. -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489 -libziparchive_common_cpp_flags := \ - -Wold-style-cast \ - -Wno-missing-field-initializers \ - -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := $(libziparchive_source_files) -LOCAL_STATIC_LIBRARIES := libz -LOCAL_SHARED_LIBRARIES := libutils libbase -LOCAL_MODULE:= libziparchive -LOCAL_CFLAGS := $(libziparchive_common_c_flags) -LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := $(libziparchive_source_files) -LOCAL_STATIC_LIBRARIES := libz libutils libbase -LOCAL_MODULE:= libziparchive-host -LOCAL_CFLAGS := $(libziparchive_common_c_flags) -LOCAL_CFLAGS_windows := -mno-ms-bitfields -LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) - -LOCAL_MULTILIB := both -LOCAL_MODULE_HOST_OS := darwin linux windows -include $(BUILD_HOST_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := $(libziparchive_source_files) -LOCAL_STATIC_LIBRARIES := libutils -LOCAL_SHARED_LIBRARIES := libz-host liblog libbase -LOCAL_MODULE:= libziparchive-host -LOCAL_CFLAGS := $(libziparchive_common_c_flags) -LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) -LOCAL_MULTILIB := both -include $(BUILD_HOST_SHARED_LIBRARY) - -# Tests. -include $(CLEAR_VARS) -LOCAL_MODULE := ziparchive-tests -LOCAL_CPP_EXTENSION := .cc -LOCAL_CFLAGS := $(libziparchive_common_c_flags) -LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) -LOCAL_SRC_FILES := $(libziparchive_test_files) -LOCAL_SHARED_LIBRARIES := \ - libbase \ - liblog \ - -LOCAL_STATIC_LIBRARIES := \ - libziparchive \ - libz \ - libutils \ - -include $(BUILD_NATIVE_TEST) - -include $(CLEAR_VARS) -LOCAL_MODULE := ziparchive-tests-host -LOCAL_CPP_EXTENSION := .cc -LOCAL_CFLAGS := $(libziparchive_common_c_flags) -LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(libziparchive_common_cpp_flags) -LOCAL_SRC_FILES := $(libziparchive_test_files) -LOCAL_STATIC_LIBRARIES := \ - libziparchive-host \ - libz \ - libbase \ - libutils \ - liblog \ - -LOCAL_MODULE_HOST_OS := darwin linux windows -include $(BUILD_HOST_NATIVE_TEST) |