blob: 8ff94d4122a040752be208bae8c7241e3a2820c9 [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
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070018source_files := zip_archive.cc zip_writer.cc
19test_files := zip_archive_test.cc zip_writer_test.cc entry_name_utils_test.cc
20
21# Incorrectly warns when C++11 empty brace {} initializer is used.
22# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489
23common_cpp_flags := -Wno-missing-field-initializers
Narayan Kamath7462f022013-11-21 13:05:04 +000024
Dan Albert27d166c2014-10-16 20:47:51 -070025include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000026LOCAL_CPP_EXTENSION := .cc
27LOCAL_SRC_FILES := ${source_files}
Narayan Kamath7462f022013-11-21 13:05:04 +000028LOCAL_STATIC_LIBRARIES := libz
Dan Albert1ae07642015-04-09 14:11:18 -070029LOCAL_SHARED_LIBRARIES := libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000030LOCAL_MODULE:= libziparchive
Dmitriy Ivanovf4cb8e22015-03-06 10:50:56 -080031LOCAL_CFLAGS := -Werror -Wall
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070032LOCAL_CPPFLAGS := -Wold-style-cast $(common_cpp_flags)
Narayan Kamath7462f022013-11-21 13:05:04 +000033include $(BUILD_STATIC_LIBRARY)
34
35include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000036LOCAL_CPP_EXTENSION := .cc
37LOCAL_SRC_FILES := ${source_files}
Dan Albert1ae07642015-04-09 14:11:18 -070038LOCAL_STATIC_LIBRARIES := libz libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000039LOCAL_MODULE:= libziparchive-host
Mark Salyzyn51d562d2014-05-05 14:38:05 -070040LOCAL_CFLAGS := -Werror
Dan Willemsen87a419c2015-08-13 14:43:34 -070041LOCAL_CFLAGS_windows := -mno-ms-bitfields
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070042LOCAL_CPPFLAGS := $(common_cpp_flags)
43
Ian Rogers5af80aa2014-06-17 01:50:25 -070044LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070045LOCAL_MODULE_HOST_OS := darwin linux windows
Narayan Kamath7462f022013-11-21 13:05:04 +000046include $(BUILD_HOST_STATIC_LIBRARY)
47
48include $(CLEAR_VARS)
Ian Rogers40ac96c2014-10-30 09:53:38 -070049LOCAL_CPP_EXTENSION := .cc
50LOCAL_SRC_FILES := ${source_files}
Evgenii Stepanov953314f2015-06-29 16:27:44 -070051LOCAL_STATIC_LIBRARIES := libutils
52LOCAL_SHARED_LIBRARIES := libz-host liblog libbase
Ian Rogers40ac96c2014-10-30 09:53:38 -070053LOCAL_MODULE:= libziparchive-host
54LOCAL_CFLAGS := -Werror
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070055LOCAL_CPPFLAGS := $(common_cpp_flags)
Ian Rogers40ac96c2014-10-30 09:53:38 -070056LOCAL_MULTILIB := both
57include $(BUILD_HOST_SHARED_LIBRARY)
58
Dan Albert27d166c2014-10-16 20:47:51 -070059# Tests.
Ian Rogers40ac96c2014-10-30 09:53:38 -070060include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000061LOCAL_MODULE := ziparchive-tests
62LOCAL_CPP_EXTENSION := .cc
Dan Albert27d166c2014-10-16 20:47:51 -070063LOCAL_CFLAGS := -Werror
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070064LOCAL_CPPFLAGS := $(common_cpp_flags)
65LOCAL_SRC_FILES := $(test_files)
Dan Albert1ae07642015-04-09 14:11:18 -070066LOCAL_SHARED_LIBRARIES := liblog libbase
Dan Albert27d166c2014-10-16 20:47:51 -070067LOCAL_STATIC_LIBRARIES := libziparchive libz libutils
Narayan Kamath7462f022013-11-21 13:05:04 +000068include $(BUILD_NATIVE_TEST)
Narayan Kamath58aaf462013-12-10 16:47:14 +000069
70include $(CLEAR_VARS)
71LOCAL_MODULE := ziparchive-tests-host
72LOCAL_CPP_EXTENSION := .cc
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070073LOCAL_CFLAGS := -Werror
74LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(common_cpp_flags)
75LOCAL_SRC_FILES := $(test_files)
Dan Albert1ae07642015-04-09 14:11:18 -070076LOCAL_SHARED_LIBRARIES := libziparchive-host liblog libbase
Ian Rogers40ac96c2014-10-30 09:53:38 -070077LOCAL_STATIC_LIBRARIES := \
Dan Albert27d166c2014-10-16 20:47:51 -070078 libz \
79 libutils
Narayan Kamath58aaf462013-12-10 16:47:14 +000080include $(BUILD_HOST_NATIVE_TEST)