• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/ohos.gni")
15import("../../../../appexecfwk.gni")
16
17config("zip_config") {
18  include_dirs = [
19    "include",
20    "napi",
21    "//third_party/libuv/include",
22    "//third_party/node/src",
23    "//third_party/zlib",
24    "${kits_path}/js/common",
25  ]
26
27  defines = [
28    "APP_LOG_TAG = \"Zlib\"",
29    "LOG_DOMAIN = 0xD001120",
30  ]
31}
32
33ohos_shared_library("zlib") {
34  public_configs = [ ":zip_config" ]
35
36  sources = [
37    "napi/napi_zlib.cpp",
38    "napi/napi_zlib_common.cpp",
39    "napi/native_module.cpp",
40    "napi/zlib_callback_info.cpp",
41    "src/file_path.cpp",
42    "src/zip.cpp",
43    "src/zip_internal.cpp",
44    "src/zip_reader.cpp",
45    "src/zip_utils.cpp",
46    "src/zip_writer.cpp",
47  ]
48
49  cflags = []
50  if (target_cpu == "arm") {
51    cflags += [ "-DBINDER_IPC_32BIT" ]
52  }
53
54  deps = [
55    "${base_path}:appexecfwk_base",
56    "${common_path}:libappexecfwk_common",
57    "${core_path}:appexecfwk_core",
58    "${kits_path}/js/common:bundle_napi_common",
59    "//third_party/zlib:shared_libz",
60  ]
61
62  external_deps = [
63    "c_utils:utils",
64    "eventhandler:libeventhandler",
65    "hilog:libhilog",
66    "hilog:libhilog_base",
67    "napi:ace_napi",
68  ]
69
70  install_enable = true
71  subsystem_name = "bundlemanager"
72  part_name = "bundle_framework"
73  relative_install_dir = "module"
74}
75
76group("tools_zip") {
77  if (support_jsapi) {
78    deps = [ ":zlib" ]
79  }
80}
81