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