1# Copyright (c) 2024 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("cj_bundle_manager_ffi_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ "src/" ] 20} 21 22ohos_shared_library("cj_bundle_manager_ffi") { 23 public_configs = [ ":cj_bundle_manager_ffi_config" ] 24 25 branch_protector_ret = "pac_ret" 26 27 sanitize = { 28 boundary_sanitize = true 29 cfi = true 30 cfi_cross_dso = true 31 debug = false 32 integer_overflow = true 33 ubsan = true 34 } 35 36 include_dirs = [ 37 "${bundle_framework_path}/common/log/include", 38 "src", 39 "${base_path}/include", 40 "${kits_path}/js/bundle_manager", 41 "${kits_path}/js/default_app", 42 "${kits_path}/js/zip/include", 43 "${kits_path}/js/common", 44 ] 45 46 if (!defined(defines)) { 47 defines = [] 48 } 49 50 cflags = [ 51 "-Os", 52 "-fstack-protector-strong", 53 ] 54 55 cflags_cc = [ 56 "-Os", 57 "-fstack-protector-strong", 58 ] 59 60 if (product_name != "ohos-sdk") { 61 sources = [ 62 "${kits_path}/js/zip/src/file_path.cpp", 63 "${kits_path}/js/zip/src/zip_internal.cpp", 64 "${kits_path}/js/zip/src/zip_reader.cpp", 65 "${kits_path}/js/zip/src/zip_utils.cpp", 66 "${kits_path}/js/zip/src/zip_writer.cpp", 67 "src/bundle_manager.cpp", 68 "src/bundle_manager_convert.cpp", 69 "src/bundle_manager_ffi.cpp", 70 "src/checksum_ffi.cpp", 71 "src/cj_zip.cpp", 72 "src/default_app.cpp", 73 "src/gzip_ffi.cpp", 74 "src/zip_ffi.cpp", 75 ] 76 77 deps = [ 78 "${base_path}:appexecfwk_base", 79 "${common_path}:libappexecfwk_common", 80 "${core_path}:appexecfwk_core", 81 "${kits_path}/js/common:bundle_napi_common", 82 "${kits_path}/js/zip:zlib", 83 ] 84 85 external_deps = [ 86 "ability_base:want", 87 "c_utils:utils", 88 "eventhandler:libeventhandler", 89 "ffrt:libffrt", 90 "hilog:libhilog", 91 "ipc:ipc_core", 92 "napi:ace_napi", 93 "napi:cj_bind_ffi", 94 "samgr:samgr_proxy", 95 "zlib:shared_libz", 96 ] 97 } else { 98 defines += [ "PREVIEWER" ] 99 sources = [ "src/bundle_manager_mock.cpp" ] 100 } 101 102 if (current_os == "ohos") { 103 defines += [ "OHOS_PLATFORM" ] 104 } 105 106 if (current_os == "mingw") { 107 defines += [ "WINDOWS_PLATFORM" ] 108 } 109 110 innerapi_tags = [ "platformsdk" ] 111 subsystem_name = "bundlemanager" 112 part_name = "bundle_framework" 113} 114