BUILD.gn 2.0 KB
Newer Older
D
dujingcheng 已提交
1
# Copyright (c) 2019-2022 Huawei Device Co., Ltd. All rights reserved.
K
k00229000 已提交
2

M
mamingshuai 已提交
3 4
import("//build/ohos.gni")
import("//build/ohos/ndk/ndk.gni")
K
k00229000 已提交
5 6

config("zlib_config") {
M
mamingshuai 已提交
7 8 9
  cflags = [
    "-Wno-incompatible-pointer-types",
    "-Werror",
S
shuaiyutao 已提交
10
    "-Wno-strict-prototypes",
M
mamingshuai 已提交
11 12
    "-Wimplicit-function-declaration",
  ]
K
k00229000 已提交
13 14
}

M
mamingshuai 已提交
15 16 17 18 19 20
config("zlib_public_config") {
  include_dirs = [ "." ]
}

ohos_static_library("libz") {
  sources = [
K
k00229000 已提交
21 22
    "adler32.c",
    "compress.c",
M
mamingshuai 已提交
23 24
    "contrib/minizip/ioapi.c",
    "contrib/minizip/unzip.c",
B
blackleon 已提交
25
    "contrib/minizip/zip.c",
K
k00229000 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39
    "crc32.c",
    "crc32.h",
    "deflate.c",
    "deflate.h",
    "gzclose.c",
    "gzguts.h",
    "gzlib.c",
    "gzread.c",
    "gzwrite.c",
    "infback.c",
    "inffast.c",
    "inffast.h",
    "inffixed.h",
    "inflate.c",
M
mamingshuai 已提交
40
    "inflate.h",
K
k00229000 已提交
41 42 43 44 45 46 47 48 49
    "inftrees.c",
    "inftrees.h",
    "trees.c",
    "trees.h",
    "uncompr.c",
    "zconf.h",
    "zlib.h",
    "zutil.c",
    "zutil.h",
M
mamingshuai 已提交
50 51 52
  ]
  configs = [ ":zlib_config" ]
  public_configs = [ ":zlib_public_config" ]
53 54 55

  part_name = "zlib"
  subsystem_name = "thirdparty"
X
x00334695 已提交
56 57
}

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
ohos_shared_library("shared_libz") {
  sources = [
    "adler32.c",
    "compress.c",
    "contrib/minizip/ioapi.c",
    "contrib/minizip/unzip.c",
    "contrib/minizip/zip.c",
    "crc32.c",
    "crc32.h",
    "deflate.c",
    "deflate.h",
    "gzclose.c",
    "gzguts.h",
    "gzlib.c",
    "gzread.c",
    "gzwrite.c",
    "infback.c",
    "inffast.c",
    "inffast.h",
    "inffixed.h",
    "inflate.c",
    "inflate.h",
    "inftrees.c",
    "inftrees.h",
    "trees.c",
    "trees.h",
    "uncompr.c",
    "zconf.h",
    "zlib.h",
    "zutil.c",
    "zutil.h",
  ]
  configs = [ ":zlib_config" ]
  public_configs = [ ":zlib_public_config" ]

93 94 95 96 97 98 99
  install_images = [
    "system",
    "updater",
  ]

  symlink_target_name = [ "libz.so" ]

100 101 102 103
  part_name = "zlib"
  subsystem_name = "thirdparty"
}

M
mamingshuai 已提交
104 105 106 107 108 109
ohos_ndk_headers("zlib_header") {
  sources = [
    "./zconf.h",
    "./zlib.h",
  ]
}
W
wenjun 已提交
110

M
mamingshuai 已提交
111 112 113 114
ohos_ndk_library("libz_ndk") {
  output_name = "z"
  ndk_description_file = "./zlib.ndk.json"
  output_extension = "so"
X
x00334695 已提交
115
}