1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("$build_root/ark.gni")
15
16config("zlib_config") {
17  cflags = [
18    "-Wno-incompatible-pointer-types",
19    "-Werror",
20    "-Wno-strict-prototypes",
21    "-Wimplicit-function-declaration",
22    "-Wno-unused-but-set-variable",
23  ]
24}
25
26config("zlib_public_config") {
27  include_dirs = [ "//third_party/zlib" ]
28}
29
30ohos_static_library("libz") {
31  stack_protector_ret = false
32  sources = [
33    "//third_party/zlib/adler32.c",
34    "//third_party/zlib/compress.c",
35    "//third_party/zlib/contrib/minizip/ioapi.c",
36    "//third_party/zlib/contrib/minizip/unzip.c",
37    "//third_party/zlib/contrib/minizip/zip.c",
38    "//third_party/zlib/crc32.c",
39    "//third_party/zlib/crc32.h",
40    "//third_party/zlib/deflate.c",
41    "//third_party/zlib/deflate.h",
42    "//third_party/zlib/gzclose.c",
43    "//third_party/zlib/gzguts.h",
44    "//third_party/zlib/gzlib.c",
45    "//third_party/zlib/gzread.c",
46    "//third_party/zlib/gzwrite.c",
47    "//third_party/zlib/infback.c",
48    "//third_party/zlib/inffast.c",
49    "//third_party/zlib/inffast.h",
50    "//third_party/zlib/inffixed.h",
51    "//third_party/zlib/inflate.c",
52    "//third_party/zlib/inflate.h",
53    "//third_party/zlib/inftrees.c",
54    "//third_party/zlib/inftrees.h",
55    "//third_party/zlib/trees.c",
56    "//third_party/zlib/trees.h",
57    "//third_party/zlib/uncompr.c",
58    "//third_party/zlib/zconf.h",
59    "//third_party/zlib/zlib.h",
60    "//third_party/zlib/zutil.c",
61    "//third_party/zlib/zutil.h",
62  ]
63  configs = [ ":zlib_config" ]
64  public_configs = [ ":zlib_public_config" ]
65
66  part_name = "zlib"
67  subsystem_name = "thirdparty"
68}
69
70ohos_shared_library("shared_libz") {
71  stack_protector_ret = false
72  sources = [
73    "//third_party/zlib/adler32.c",
74    "//third_party/zlib/compress.c",
75    "//third_party/zlib/contrib/minizip/ioapi.c",
76    "//third_party/zlib/contrib/minizip/unzip.c",
77    "//third_party/zlib/contrib/minizip/zip.c",
78    "//third_party/zlib/crc32.c",
79    "//third_party/zlib/crc32.h",
80    "//third_party/zlib/deflate.c",
81    "//third_party/zlib/deflate.h",
82    "//third_party/zlib/gzclose.c",
83    "//third_party/zlib/gzguts.h",
84    "//third_party/zlib/gzlib.c",
85    "//third_party/zlib/gzread.c",
86    "//third_party/zlib/gzwrite.c",
87    "//third_party/zlib/infback.c",
88    "//third_party/zlib/inffast.c",
89    "//third_party/zlib/inffast.h",
90    "//third_party/zlib/inffixed.h",
91    "//third_party/zlib/inflate.c",
92    "//third_party/zlib/inflate.h",
93    "//third_party/zlib/inftrees.c",
94    "//third_party/zlib/inftrees.h",
95    "//third_party/zlib/trees.c",
96    "//third_party/zlib/trees.h",
97    "//third_party/zlib/uncompr.c",
98    "//third_party/zlib/zconf.h",
99    "//third_party/zlib/zlib.h",
100    "//third_party/zlib/zutil.c",
101    "//third_party/zlib/zutil.h",
102  ]
103  configs = [ ":zlib_config" ]
104  public_configs = [ ":zlib_public_config" ]
105
106  install_images = [
107    "system",
108    "updater",
109  ]
110
111  innerapi_tags = [ "platformsdk" ]
112  part_name = "zlib"
113  subsystem_name = "thirdparty"
114}
115