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 17ohos_shared_library("cj_bundle_manager_ffi") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 debug = false 22 } 23 24 include_dirs = [ 25 "src", 26 "${base_path}/include", 27 "${kits_path}/js/bundle_manager", 28 "${kits_path}/js/common", 29 ] 30 31 if (!defined(defines)) { 32 defines = [] 33 } 34 35 cflags = [ "-Os" ] 36 cflags_cc = [ "-Os" ] 37 38 if (product_name != "ohos-sdk") { 39 sources = [ 40 "src/bundle_manager.cpp", 41 "src/bundle_manager_convert.cpp", 42 "src/bundle_manager_ffi.cpp", 43 ] 44 45 deps = [ 46 "${base_path}:appexecfwk_base", 47 "${common_path}:libappexecfwk_common", 48 "${core_path}:appexecfwk_core", 49 "${kits_path}/js/common:bundle_napi_common", 50 ] 51 52 external_deps = [ 53 "ability_base:want", 54 "c_utils:utils", 55 "hilog:libhilog", 56 "ipc:ipc_core", 57 "napi:ace_napi", 58 "napi:cj_bind_ffi", 59 ] 60 } else { 61 defines += [ "PREVIEWER" ] 62 sources = [ "src/bundle_manager_mock.cpp" ] 63 } 64 65 if (current_os == "ohos") { 66 defines += [ "OHOS_PLATFORM" ] 67 } 68 69 if (current_os == "mingw") { 70 defines += [ "WINDOWS_PLATFORM" ] 71 } 72 73 innerapi_tags = [ "platformsdk" ] 74 subsystem_name = "bundlemanager" 75 part_name = "bundle_framework" 76} 77