1# 2# Copyright (c) 2020 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16import("//build/lite/config/component/lite_component.gni") 17 18config("zlib_config") { 19 include_dirs = [ "//third_party/zlib" ] 20} 21 22zlib_source = [ 23 "//third_party/zlib/adler32.c", 24 "//third_party/zlib/compress.c", 25 "//third_party/zlib/crc32.c", 26 "//third_party/zlib/crc32.h", 27 "//third_party/zlib/deflate.c", 28 "//third_party/zlib/deflate.h", 29 "//third_party/zlib/gzclose.c", 30 "//third_party/zlib/gzguts.h", 31 "//third_party/zlib/gzlib.c", 32 "//third_party/zlib/gzread.c", 33 "//third_party/zlib/gzwrite.c", 34 "//third_party/zlib/infback.c", 35 "//third_party/zlib/inffast.c", 36 "//third_party/zlib/inffast.h", 37 "//third_party/zlib/inffixed.h", 38 "//third_party/zlib/inflate.h", 39 "//third_party/zlib/inflate.c", 40 "//third_party/zlib/inftrees.c", 41 "//third_party/zlib/inftrees.h", 42 "//third_party/zlib/trees.c", 43 "//third_party/zlib/trees.h", 44 "//third_party/zlib/uncompr.c", 45 "//third_party/zlib/zconf.h", 46 "//third_party/zlib/zlib.h", 47 "//third_party/zlib/zutil.c", 48 "//third_party/zlib/zutil.h", 49 "//third_party/zlib/contrib/minizip/ioapi.c", 50 "//third_party/zlib/contrib/minizip/unzip.c", 51 "//third_party/zlib/contrib/minizip/zip.c", 52] 53 54lite_library("zlib_shared") { 55 target_type = "shared_library" 56 sources = zlib_source 57 58 public_configs = [ ":zlib_config" ] 59} 60 61lite_library("zlib_static") { 62 target_type = "static_library" 63 sources = zlib_source 64 65 public_configs = [ ":zlib_config" ] 66 if (board_toolchain_type == "iccarm") { 67 cflags = [ 68 "--diag_suppress", 69 "Pe111,Pe147,Pe223", 70 ] 71 defines = [ "IOAPI_NO_64" ] 72 } 73} 74