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("//foundation/ability/ability_runtime/ability_runtime.gni") 16import("//foundation/ability/ability_runtime/cj_environment/cj_environment.gni") 17 18config("cj_want_agent_public_config") { 19 visibility = [ ":*" ] 20 include_dirs = [ "include" ] 21 visibility += [ 22 "${ability_runtime_innerkits_path}/wantagent/*", 23 "${ability_runtime_napi_path}/inner/*", 24 "${ability_runtime_native_path}/ability/native/*", 25 "${distributed_notification_service_path}/*", 26 ] 27 include_dirs += [ 28 "${ability_runtime_innerkits_path}/ability_manager/include", 29 "${ability_runtime_innerkits_path}/wantagent/include", 30 "${ability_runtime_services_path}/abilitymgr/include/utils", 31 "${ability_runtime_services_path}/abilitymgr/include", 32 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 33 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 34 "${ability_runtime_path}/interfaces/kits/native/appkit", 35 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", 36 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 37 ] 38} 39 40ohos_shared_library("cj_want_agent_ffi") { 41 defines = [ 42 "AMS_LOG_TAG = \"CJ_ABILITY_FFI\"", 43 "AMS_LOG_DOMAIN = 0xD001150", 44 ] 45 46 branch_protector_ret = "pac_ret" 47 48 sanitize = { 49 cfi = true 50 cfi_cross_dso = true 51 debug = false 52 } 53 54 include_dirs = [ 55 "${ability_runtime_path}/interfaces/kits/native/ability/native", 56 "${ability_runtime_path}/frameworks/cj/ffi", 57 "${ability_runtime_path}/frameworks/cj/ffi/want_agent", 58 "${ability_runtime_services_path}/common/include", 59 ] 60 61 public_configs = [ ":cj_want_agent_public_config" ] 62 63 deps = [ 64 "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", 65 "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", 66 "${ability_runtime_native_path}/appkit:app_context", 67 "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi", 68 ] 69 70 external_deps = [ 71 "ability_base:want", 72 "c_utils:utils", 73 "hilog:libhilog", 74 "ipc:ipc_single", 75 "napi:ace_napi", 76 "napi:cj_bind_ffi", 77 "napi:cj_bind_native", 78 ] 79 80 sources = [ 81 "src/cj_want_agent_ffi.cpp", 82 "src/cj_want_agent_object.cpp", 83 ] 84 85 cflags = [ 86 "-O2", 87 "-D_FORTIFY_SOURCE=2", 88 ] 89 90 cflags_cc = cflags 91 92 innerapi_tags = [ "platformsdk" ] 93 subsystem_name = "ability" 94 part_name = "ability_runtime" 95} 96