• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("../../../access_token.gni")
16
17config("accesstoken") {
18  visibility = [ ":*" ]
19  include_dirs = [ "include" ]
20}
21
22if (is_standard_system) {
23  ohos_shared_library("libaccesstoken_sdk") {
24    subsystem_name = "security"
25    part_name = "access_token"
26    sanitize = {
27      cfi = true
28      cfi_cross_dso = true
29      debug = false
30    }
31    branch_protector_ret = "pac_ret"
32
33    innerapi_tags = [
34      "chipsetsdk",
35      "platformsdk",
36      "sasdk",
37    ]
38    if (!use_clang_coverage) {
39      version_script = "libaccesstoken_sdk.map"
40    }
41
42    output_name = "libaccesstoken_sdk"
43
44    public_configs = [
45      ":accesstoken",
46      "${access_token_path}/services/accesstokenmanager/idl:access_token_manager_gen_config",
47    ]
48
49    include_dirs = [
50      "${access_token_path}/frameworks/accesstoken/include",
51      "${access_token_path}/frameworks/common/include",
52      "src",
53    ]
54
55    sources = [
56      "src/accesstoken_callback_stubs.cpp",
57      "src/accesstoken_callbacks.cpp",
58      "src/accesstoken_death_recipient.cpp",
59      "src/accesstoken_kit.cpp",
60      "src/accesstoken_manager_client.cpp",
61      "src/perm_state_change_callback_customize.cpp",
62    ]
63
64    deps = [
65      "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx",
66      "${access_token_path}/frameworks/common:accesstoken_common_cxx",
67      "${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc",
68      "${access_token_path}/services/accesstokenmanager/idl:access_token_manager_proxy",
69    ]
70
71    external_deps = [
72      "c_utils:utils",
73      "hilog:libhilog",
74      "init:libbegetutil",
75      "ipc:ipc_single",
76      "samgr:samgr_proxy",
77    ]
78
79    configs = [
80      "${access_token_path}/config:access_token_compile_flags",
81      "${access_token_path}/config:coverage_flags",
82    ]
83
84    cflags_cc = [
85      "-DHILOG_ENABLE",
86      "-DDEBUG_API_PERFORMANCE",
87    ]
88
89    if (build_variant == "user") {
90      cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ]
91    }
92
93    if (token_sync_enable == true) {
94      cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ]
95    }
96    if (security_component_enhance_enable == true) {
97      cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ]
98    }
99  }
100}
101
102if (is_standard_system) {
103  ohos_shared_library("libtokenid_sdk") {
104    subsystem_name = "security"
105    part_name = "access_token"
106    sanitize = {
107      cfi = true
108      cfi_cross_dso = true
109      debug = false
110    }
111    branch_protector_ret = "pac_ret"
112    innerapi_tags = [
113      "platformsdk",
114      "sasdk",
115    ]
116
117    output_name = "libtokenid_sdk"
118    public_configs = [ ":accesstoken" ]
119
120    include_dirs = [ "${access_token_path}/frameworks/common/include" ]
121    sources = [ "src/tokenid_kit.cpp" ]
122
123    deps = []
124    external_deps = [
125      "c_utils:utils",
126      "hilog:libhilog",
127    ]
128
129    configs = [
130      "${access_token_path}/config:access_token_compile_flags",
131      "${access_token_path}/config:coverage_flags",
132    ]
133    cflags_cc = [ "-DHILOG_ENABLE" ]
134    if (security_component_enhance_enable == true) {
135      cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ]
136    }
137  }
138}
139