• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
2
3import("//build/ohos.gni")
4import("//build/ohos/ndk/ndk.gni")
5
6config("zlib_config") {
7  cflags = [
8    "-Wno-incompatible-pointer-types",
9    "-Werror",
10    "-Wno-strict-prototypes",
11    "-Wimplicit-function-declaration",
12  ]
13}
14
15config("zlib_public_config") {
16  include_dirs = [ "." ]
17}
18
19ohos_static_library("libz") {
20  sources = [
21    "adler32.c",
22    "compress.c",
23    "contrib/minizip/ioapi.c",
24    "contrib/minizip/unzip.c",
25    "contrib/minizip/zip.c",
26    "crc32.c",
27    "crc32.h",
28    "deflate.c",
29    "deflate.h",
30    "gzclose.c",
31    "gzguts.h",
32    "gzlib.c",
33    "gzread.c",
34    "gzwrite.c",
35    "infback.c",
36    "inffast.c",
37    "inffast.h",
38    "inffixed.h",
39    "inflate.c",
40    "inflate.h",
41    "inftrees.c",
42    "inftrees.h",
43    "trees.c",
44    "trees.h",
45    "uncompr.c",
46    "zconf.h",
47    "zlib.h",
48    "zutil.c",
49    "zutil.h",
50  ]
51  configs = [ ":zlib_config" ]
52  public_configs = [ ":zlib_public_config" ]
53
54  part_name = "zlib"
55  subsystem_name = "thirdparty"
56}
57
58ohos_shared_library("shared_libz") {
59  sources = [
60    "adler32.c",
61    "compress.c",
62    "contrib/minizip/ioapi.c",
63    "contrib/minizip/unzip.c",
64    "contrib/minizip/zip.c",
65    "crc32.c",
66    "crc32.h",
67    "deflate.c",
68    "deflate.h",
69    "gzclose.c",
70    "gzguts.h",
71    "gzlib.c",
72    "gzread.c",
73    "gzwrite.c",
74    "infback.c",
75    "inffast.c",
76    "inffast.h",
77    "inffixed.h",
78    "inflate.c",
79    "inflate.h",
80    "inftrees.c",
81    "inftrees.h",
82    "trees.c",
83    "trees.h",
84    "uncompr.c",
85    "zconf.h",
86    "zlib.h",
87    "zutil.c",
88    "zutil.h",
89  ]
90  configs = [ ":zlib_config" ]
91  public_configs = [ ":zlib_public_config" ]
92
93  install_images = [
94    "system",
95    "updater",
96  ]
97
98  symlink_target_name = [ "libz.so" ]
99
100  innerapi_tags = [ "platformsdk" ]
101  part_name = "zlib"
102  subsystem_name = "thirdparty"
103}
104
105ohos_ndk_headers("zlib_header") {
106  sources = [
107    "./zconf.h",
108    "./zlib.h",
109  ]
110}
111
112ohos_ndk_library("libz_ndk") {
113  output_name = "z"
114  ndk_description_file = "./zlib.ndk.json"
115  output_extension = "so"
116}
117