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_context_ffi_public_config") { 19 visibility = [ 20 ":*", 21 "${ability_runtime_native_path}/ability/*", 22 ] 23 include_dirs = [ "${ability_runtime_path}/frameworks/cj/ffi/context" ] 24} 25 26ohos_shared_library("cj_context_ffi") { 27 defines = [ 28 "AMS_LOG_TAG = \"CJ_ABILITY_FFI\"", 29 "AMS_LOG_DOMAIN = 0xD001150", 30 ] 31 sanitize = { 32 cfi = true 33 cfi_cross_dso = true 34 debug = false 35 } 36 include_dirs = [ 37 "${ability_runtime_path}/interfaces/kits/native/ability/native", 38 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 39 "${ability_runtime_path}/frameworks/cj/ffi", 40 "${ability_runtime_path}/frameworks/cj/ffi/context", 41 "${ability_runtime_path}/frameworks/cj/ffi/application_context/include", 42 "${ability_runtime_services_path}/common/include", 43 ] 44 45 public_configs = [ ":cj_context_ffi_public_config" ] 46 47 deps = [ 48 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 49 "${ability_runtime_native_path}/appkit:app_context", 50 "${ability_runtime_native_path}/appkit:app_context_utils", 51 "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi", 52 ] 53 54 external_deps = [ 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:cj_bundle_manager_ffi", 57 "c_utils:utils", 58 "eventhandler:libeventhandler", 59 "hilog:libhilog", 60 "ipc:ipc_core", 61 "ipc:ipc_napi", 62 "napi:ace_napi", 63 "napi:cj_bind_ffi", 64 "napi:cj_bind_native", 65 ] 66 67 sources = [ "cj_context.cpp" ] 68 69 cflags = [ 70 "-fstack-protector-all", 71 "-fstack-protector-strong", 72 "-O2", 73 "-D_FORTIFY_SOURCE=2", 74 ] 75 76 cflags_cc = cflags 77 78 innerapi_tags = [ "platformsdk" ] 79 subsystem_name = "ability" 80 part_name = "ability_runtime" 81} 82