• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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("../../../../access_token.gni")
16
17config("cj_ability_access_ctrl_ffi_config") {
18  include_dirs = [ "include" ]
19}
20
21ohos_shared_library("cj_ability_access_ctrl_ffi") {
22  sanitize = {
23    cfi = true
24    cfi_cross_dso = true
25    debug = false
26  }
27  branch_protector_ret = "pac_ret"
28  include_dirs = [
29    "${access_token_path}/frameworks/common/include",
30    "${access_token_path}/interfaces/innerkits/accesstoken/include",
31    "${access_token_path}/interfaces/innerkits/token_callback/include",
32    "${access_token_path}/interfaces/innerkits/token_setproc/include",
33    "../../napi/common/include",
34  ]
35
36  if (!defined(defines)) {
37    defines = []
38  }
39
40  if (!ohos_indep_compiler_enable && product_name != "ohos-sdk") {
41    sources = [
42      "src/ability_access_ctrl_ffi.cpp",
43      "src/at_manager_impl.cpp",
44      "src/request_global_switch_on_setting.cpp",
45      "src/request_permission_on_setting.cpp",
46    ]
47
48    deps = [
49      "${access_token_path}/frameworks/js/napi/common:libnapi_common",
50      "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
51      "${access_token_path}/interfaces/innerkits/token_callback:libtoken_callback_sdk",
52      "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared",
53    ]
54
55    external_deps = [
56      "ability_base:want",
57      "ability_runtime:ability_context_native",
58      "ability_runtime:ability_manager",
59      "ability_runtime:abilitykit_native",
60      "ability_runtime:napi_base_context",
61      "ability_runtime:ui_extension",
62      "ace_engine:ace_uicontent",
63      "c_utils:utils",
64      "hilog:libhilog",
65      "init:libbegetutil",
66      "ipc:ipc_single",
67      "napi:ace_napi",
68      "napi:cj_bind_ffi",
69      "napi:cj_bind_native",
70    ]
71  } else {
72    defines += [ "PREVIEWER" ]
73    sources = [ "src/ability_access_ctrl_mock.cpp" ]
74    external_deps = [ "napi:cj_bind_ffi" ]
75  }
76
77  cflags_cc = [ "-DHILOG_ENABLE" ]
78  public_configs = [ ":cj_ability_access_ctrl_ffi_config" ]
79  configs = [
80    "${access_token_path}/config:access_token_compile_flags",
81    "${access_token_path}/config:coverage_flags",
82  ]
83
84  if (current_os == "ohos") {
85    defines += [ "OHOS_PLATFORM" ]
86  }
87
88  if (current_os == "mingw") {
89    defines += [ "WINDOWS_PLATFORM" ]
90  }
91  innerapi_tags = [ "platformsdk" ]
92  subsystem_name = "security"
93  part_name = "access_token"
94}
95