1 # 2 # Copyright (C) 2013 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 LOCAL_PATH := $(call my-dir) 17 18 libziparchive_source_files := \ 19 zip_archive.cc \ 20 zip_archive_stream_entry.cc \ 21 zip_writer.cc \ 22 23 libziparchive_test_files := \ 24 entry_name_utils_test.cc \ 25 zip_archive_test.cc \ 26 zip_writer_test.cc \ 27 28 # ZLIB_CONST turns on const for input buffers, which is pretty standard. 29 libziparchive_common_c_flags := \ 30 -DZLIB_CONST \ 31 -Werror \ 32 -Wall \ 33 34 # Incorrectly warns when C++11 empty brace {} initializer is used. 35 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489 36 libziparchive_common_cpp_flags := \ 37 -Wold-style-cast \ 38 -Wno-missing-field-initializers \ 39 40 include $(CLEAR_VARS) 41 LOCAL_CPP_EXTENSION := .cc 42 LOCAL_SRC_FILES := $(libziparchive_source_files) 43 LOCAL_STATIC_LIBRARIES := libz 44 LOCAL_SHARED_LIBRARIES := libutils libbase 45 LOCAL_MODULE:= libziparchive 46 LOCAL_CFLAGS := $(libziparchive_common_c_flags) 47 LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) 48 include $(BUILD_STATIC_LIBRARY) 49 50 include $(CLEAR_VARS) 51 LOCAL_CPP_EXTENSION := .cc 52 LOCAL_SRC_FILES := $(libziparchive_source_files) 53 LOCAL_STATIC_LIBRARIES := libz libutils libbase 54 LOCAL_MODULE:= libziparchive-host 55 LOCAL_CFLAGS := $(libziparchive_common_c_flags) 56 LOCAL_CFLAGS_windows := -mno-ms-bitfields 57 LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) 58 59 LOCAL_MULTILIB := both 60 LOCAL_MODULE_HOST_OS := darwin linux windows 61 include $(BUILD_HOST_STATIC_LIBRARY) 62 63 include $(CLEAR_VARS) 64 LOCAL_CPP_EXTENSION := .cc 65 LOCAL_SRC_FILES := $(libziparchive_source_files) 66 LOCAL_STATIC_LIBRARIES := libutils 67 LOCAL_SHARED_LIBRARIES := libz-host liblog libbase 68 LOCAL_MODULE:= libziparchive-host 69 LOCAL_CFLAGS := $(libziparchive_common_c_flags) 70 LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) 71 LOCAL_MULTILIB := both 72 include $(BUILD_HOST_SHARED_LIBRARY) 73 74 # Tests. 75 include $(CLEAR_VARS) 76 LOCAL_MODULE := ziparchive-tests 77 LOCAL_CPP_EXTENSION := .cc 78 LOCAL_CFLAGS := $(libziparchive_common_c_flags) 79 LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) 80 LOCAL_SRC_FILES := $(libziparchive_test_files) 81 LOCAL_SHARED_LIBRARIES := \ 82 libbase \ 83 liblog \ 84 85 LOCAL_STATIC_LIBRARIES := \ 86 libziparchive \ 87 libz \ 88 libutils \ 89 90 include $(BUILD_NATIVE_TEST) 91 92 include $(CLEAR_VARS) 93 LOCAL_MODULE := ziparchive-tests-host 94 LOCAL_CPP_EXTENSION := .cc 95 LOCAL_CFLAGS := $(libziparchive_common_c_flags) 96 LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(libziparchive_common_cpp_flags) 97 LOCAL_SRC_FILES := $(libziparchive_test_files) 98 LOCAL_STATIC_LIBRARIES := \ 99 libziparchive-host \ 100 libz \ 101 libbase \ 102 libutils \ 103 liblog \ 104 105 LOCAL_MODULE_HOST_OS := darwin linux windows 106 include $(BUILD_HOST_NATIVE_TEST) 107