blob: 3cd8b87b16c4c8d67f0266c4bbfa6429930f2d9f [file] [log] [blame]
Narayan Kamath7462f022013-11-21 13:05:04 +00001#
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
16LOCAL_PATH := $(call my-dir)
Narayan Kamath7462f022013-11-21 13:05:04 +000017
Christopher Ferrise6884ce2015-11-10 14:55:12 -080018libziparchive_source_files := \
19 zip_archive.cc \
20 zip_archive_stream_entry.cc \
21 zip_writer.cc \
22
23libziparchive_test_files := \
24 entry_name_utils_test.cc \
25 zip_archive_test.cc \
26 zip_writer_test.cc \
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070027
Adam Lesinski591fd392015-10-06 15:23:46 -070028# ZLIB_CONST turns on const for input buffers, which is pretty standard.
Christopher Ferrise6884ce2015-11-10 14:55:12 -080029libziparchive_common_c_flags := \
30 -DZLIB_CONST \
31 -Werror \
32 -Wall \
Adam Lesinski591fd392015-10-06 15:23:46 -070033
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070034# Incorrectly warns when C++11 empty brace {} initializer is used.
35# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489
Christopher Ferrise6884ce2015-11-10 14:55:12 -080036libziparchive_common_cpp_flags := \
37 -Wold-style-cast \
38 -Wno-missing-field-initializers \
Narayan Kamath7462f022013-11-21 13:05:04 +000039
Dan Albert27d166c2014-10-16 20:47:51 -070040include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000041LOCAL_CPP_EXTENSION := .cc
Christopher Ferrise6884ce2015-11-10 14:55:12 -080042LOCAL_SRC_FILES := $(libziparchive_source_files)
Narayan Kamath7462f022013-11-21 13:05:04 +000043LOCAL_STATIC_LIBRARIES := libz
Dan Albert1ae07642015-04-09 14:11:18 -070044LOCAL_SHARED_LIBRARIES := libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000045LOCAL_MODULE:= libziparchive
Christopher Ferrise6884ce2015-11-10 14:55:12 -080046LOCAL_CFLAGS := $(libziparchive_common_c_flags)
47LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags)
Narayan Kamath7462f022013-11-21 13:05:04 +000048include $(BUILD_STATIC_LIBRARY)
49
50include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000051LOCAL_CPP_EXTENSION := .cc
Christopher Ferrise6884ce2015-11-10 14:55:12 -080052LOCAL_SRC_FILES := $(libziparchive_source_files)
Dan Albert1ae07642015-04-09 14:11:18 -070053LOCAL_STATIC_LIBRARIES := libz libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000054LOCAL_MODULE:= libziparchive-host
Christopher Ferrise6884ce2015-11-10 14:55:12 -080055LOCAL_CFLAGS := $(libziparchive_common_c_flags)
Dan Willemsen87a419c2015-08-13 14:43:34 -070056LOCAL_CFLAGS_windows := -mno-ms-bitfields
Christopher Ferrise6884ce2015-11-10 14:55:12 -080057LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags)
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070058
Ian Rogers5af80aa2014-06-17 01:50:25 -070059LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070060LOCAL_MODULE_HOST_OS := darwin linux windows
Narayan Kamath7462f022013-11-21 13:05:04 +000061include $(BUILD_HOST_STATIC_LIBRARY)
62
63include $(CLEAR_VARS)
Ian Rogers40ac96c2014-10-30 09:53:38 -070064LOCAL_CPP_EXTENSION := .cc
Christopher Ferrise6884ce2015-11-10 14:55:12 -080065LOCAL_SRC_FILES := $(libziparchive_source_files)
Evgenii Stepanov953314f2015-06-29 16:27:44 -070066LOCAL_STATIC_LIBRARIES := libutils
67LOCAL_SHARED_LIBRARIES := libz-host liblog libbase
Ian Rogers40ac96c2014-10-30 09:53:38 -070068LOCAL_MODULE:= libziparchive-host
Christopher Ferrise6884ce2015-11-10 14:55:12 -080069LOCAL_CFLAGS := $(libziparchive_common_c_flags)
70LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags)
Ian Rogers40ac96c2014-10-30 09:53:38 -070071LOCAL_MULTILIB := both
72include $(BUILD_HOST_SHARED_LIBRARY)
73
Dan Albert27d166c2014-10-16 20:47:51 -070074# Tests.
Ian Rogers40ac96c2014-10-30 09:53:38 -070075include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000076LOCAL_MODULE := ziparchive-tests
77LOCAL_CPP_EXTENSION := .cc
Christopher Ferrise6884ce2015-11-10 14:55:12 -080078LOCAL_CFLAGS := $(libziparchive_common_c_flags)
79LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags)
80LOCAL_SRC_FILES := $(libziparchive_test_files)
81LOCAL_SHARED_LIBRARIES := \
82 libbase \
83 liblog \
84
85LOCAL_STATIC_LIBRARIES := \
86 libziparchive \
87 libz \
88 libutils \
89
Narayan Kamath7462f022013-11-21 13:05:04 +000090include $(BUILD_NATIVE_TEST)
Narayan Kamath58aaf462013-12-10 16:47:14 +000091
92include $(CLEAR_VARS)
93LOCAL_MODULE := ziparchive-tests-host
94LOCAL_CPP_EXTENSION := .cc
Christopher Ferrise6884ce2015-11-10 14:55:12 -080095LOCAL_CFLAGS := $(libziparchive_common_c_flags)
96LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(libziparchive_common_cpp_flags)
97LOCAL_SRC_FILES := $(libziparchive_test_files)
Ian Rogers40ac96c2014-10-30 09:53:38 -070098LOCAL_STATIC_LIBRARIES := \
Yabin Cuib2a77002016-02-08 16:26:33 -080099 libziparchive-host \
Dan Albert27d166c2014-10-16 20:47:51 -0700100 libz \
Yabin Cuib2a77002016-02-08 16:26:33 -0800101 libbase \
102 libutils \
103 liblog \
Christopher Ferrise6884ce2015-11-10 14:55:12 -0800104
Yabin Cuib2a77002016-02-08 16:26:33 -0800105LOCAL_MODULE_HOST_OS := darwin linux windows
Narayan Kamath58aaf462013-12-10 16:47:14 +0000106include $(BUILD_HOST_NATIVE_TEST)