• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  sanitize = {
46    cfi = true
47    cfi_cross_dso = true
48    debug = false
49  }
50  include_dirs = [
51    "${ability_runtime_path}/interfaces/kits/native/ability/native",
52    "${ability_runtime_path}/frameworks/cj/ffi",
53    "${ability_runtime_path}/frameworks/cj/ffi/want_agent",
54    "${ability_runtime_services_path}/common/include",
55  ]
56
57  public_configs = [ ":cj_want_agent_public_config" ]
58
59  deps = [
60    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
61    "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits",
62    "${ability_runtime_native_path}/appkit:app_context",
63    "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi",
64  ]
65
66  external_deps = [
67    "ability_base:want",
68    "c_utils:utils",
69    "hilog:libhilog",
70    "ipc:ipc_single",
71    "napi:ace_napi",
72    "napi:cj_bind_ffi",
73    "napi:cj_bind_native",
74  ]
75
76  sources = [
77    "src/cj_want_agent_ffi.cpp",
78    "src/cj_want_agent_object.cpp",
79  ]
80
81  cflags = [
82    "-fstack-protector-all",
83    "-fstack-protector-strong",
84    "-O2",
85    "-D_FORTIFY_SOURCE=2",
86  ]
87
88  cflags_cc = cflags
89
90  innerapi_tags = [ "platformsdk" ]
91  subsystem_name = "ability"
92  part_name = "ability_runtime"
93}
94