# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
import("//build/ohos.gni")
import("//foundation/bundlemanager/bundle_framework/appexecfwk.gni")
ohos_shared_library("ani_zlib") {
shlib_type = "ani"
branch_protector_ret = "pac_ret"
sanitize = {
boundary_sanitize = true
cfi = true
cfi_cross_dso = true
debug = false
integer_overflow = true
ubsan = true
}
defines = [
"APP_LOG_TAG = \"BMS\"",
"LOG_DOMAIN = 0xD001120",
]
include_dirs = [
"${inner_api_path}/appexecfwk_core/include",
"${kits_path}/ani/zlib",
"${kits_path}/ani/zlib/common",
"${kits_path}/ani/common",
"${kits_path}/js/common",
"${kits_path}/js/zip/include",
"${kits_path}/js/zip/napi",
"${kits_path}/js/zip/napi/class_checksum",
"${kits_path}/js/zip/napi/common",
]
sources = [
"${kits_path}/js/zip/napi/class_checksum/checksum_common_func.cpp",
"${kits_path}/js/zip/src/file_path.cpp",
"${kits_path}/js/zip/src/zip.cpp",
"${kits_path}/js/zip/src/zip_internal.cpp",
"${kits_path}/js/zip/src/zip_reader.cpp",
"${kits_path}/js/zip/src/zip_utils.cpp",
"${kits_path}/js/zip/src/zip_writer.cpp",
"ani_zlib.cpp",
"checksum/ani_checksum.cpp",
"common/ani_zlib_common.cpp",
"gzip/ani_gzip.cpp",
"zip/ani_zip.cpp",
]
cflags = [
"-Os",
"-fstack-protector-strong",
]
cflags_cc = [
"-Os",
"-fstack-protector-strong",
]
use_exceptions = true
deps = [
"${base_path}:appexecfwk_base",
"${common_path}:libappexecfwk_common",
"${core_path}:appexecfwk_core",
"${kits_path}/ani/common:bms_ani_common",
"${kits_path}/js/common:bundle_napi_common",
]
external_deps = [
"ability_base:want",
"c_utils:utils",
"common_event_service:cesfwk_core",
"common_event_service:cesfwk_innerkits",
"eventhandler:libeventhandler",
"ffrt:libffrt",
"hilog:libhilog",
"ipc:ipc_core",
"libuv:uv",
"napi:ace_napi",
"node:node_header_notice",
"runtime_core:ani",
"runtime_core:ani_helpers",
"samgr:samgr_proxy",
"zlib:shared_libz",
]
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
}
generate_static_abc("zlib") {
base_url = "./ets"
files = [ "./ets/@ohos.zlib.ets" ]
is_boot_abc = "True"
device_dst_file = "/system/framework/zlib.abc"
}
ohos_prebuilt_etc("zlib_etc") {
source = "$target_out_dir/zlib.abc"
module_install_dir = "framework"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
deps = [ ":zlib" ]
}