# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("../../../../appexecfwk.gni") config("zip_config") { include_dirs = [ "include", "napi", "${kits_path}/js/common", "napi/common", "napi/class_checksum", "napi/class_zip", "napi/class_gzip", ] defines = [ "APP_LOG_TAG = \"Zlib\"", "LOG_DOMAIN = 0xD001120", ] } ohos_shared_library("zlib") { public_configs = [ ":zip_config" ] sources = [ "napi/class_checksum/checksum_n_exporter.cpp", "napi/class_gzip/gzip_n_exporter.cpp", "napi/class_zip/zip_n_exporter.cpp", "napi/common/common_func.cpp", "napi/common/napi_async_work_callback.cpp", "napi/common/napi_async_work_promise.cpp", "napi/common/napi_business_error.cpp", "napi/common/napi_class.cpp", "napi/common/napi_func_arg.cpp", "napi/common/napi_reference.cpp", "napi/common/napi_value.cpp", "napi/napi_zlib.cpp", "napi/napi_zlib_common.cpp", "napi/native_module.cpp", "napi/properties/create_checksum.cpp", "napi/properties/create_gzip.cpp", "napi/properties/create_zip.cpp", "napi/properties/prop_n_exporter.cpp", "napi/zlib_callback_info.cpp", "src/file_path.cpp", "src/zip.cpp", "src/zip_internal.cpp", "src/zip_reader.cpp", "src/zip_utils.cpp", "src/zip_writer.cpp", ] cflags = [ "-Os" ] cflags_cc = [ "-Os" ] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ "${base_path}:appexecfwk_base", "${common_path}:libappexecfwk_common", "${core_path}:appexecfwk_core", "${kits_path}/js/common:bundle_napi_common", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "napi:ace_napi", "zlib:shared_libz", ] public_external_deps = [ "libuv:uv" ] install_enable = true subsystem_name = "bundlemanager" part_name = "bundle_framework" relative_install_dir = "module" } group("tools_zip") { if (support_jsapi) { deps = [ ":zlib" ] } }