1# Copyright (c) 2025 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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("../../../access_token.gni") 17 18idl_gen_interface("access_token_manager_interface") { 19 sources = [ "IAccessTokenManager.idl" ] 20 sources_common = [ "IdlCommon.idl" ] 21 log_domainid = "0xD005A01" 22 log_tag = "ATM" 23 subsystem_name = "security" 24 part_name = "access_token" 25} 26 27config("access_token_manager_gen_config") { 28 include_dirs = [ "${target_gen_dir}" ] 29} 30 31ohos_source_set("access_token_manager_proxy") { 32 sanitize = { 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 } 37 38 cflags_cc = [] 39 if (build_variant == "user") { 40 cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ] 41 } 42 if (token_sync_enable == true) { 43 cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] 44 } 45 46 output_values = get_target_outputs(":access_token_manager_interface") 47 48 include_dirs = [ 49 "${access_token_path}/frameworks/accesstoken/include", 50 "${access_token_path}/frameworks/common/include", 51 "src", 52 ] 53 54 sources = filter_include(output_values, 55 [ 56 "*_proxy.cpp", 57 "*idl_common.cpp", 58 ]) 59 60 deps = [ 61 ":access_token_manager_interface", 62 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 63 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 64 "${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc", 65 ] 66 67 external_deps = [ 68 "c_utils:utils", 69 "hilog:libhilog", 70 "init:libbegetutil", 71 "ipc:ipc_single", 72 "samgr:samgr_proxy", 73 ] 74 75 if (security_component_enhance_enable) { 76 cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] 77 } 78 79 subsystem_name = "security" 80 part_name = "access_token" 81} 82 83ohos_source_set("access_token_manager_stub") { 84 sanitize = { 85 cfi = true 86 cfi_cross_dso = true 87 debug = false 88 } 89 90 cflags_cc = [] 91 if (build_variant == "user") { 92 cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ] 93 } 94 if (token_sync_enable == true) { 95 cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] 96 } 97 98 output_values = get_target_outputs(":access_token_manager_interface") 99 100 include_dirs = [ 101 "${access_token_path}/frameworks/accesstoken/include", 102 "${access_token_path}/frameworks/common/include", 103 "src", 104 ] 105 106 sources = filter_include(output_values, 107 [ 108 "*_stub.cpp", 109 "*idl_common.cpp", 110 ]) 111 112 deps = [ 113 ":access_token_manager_interface", 114 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 115 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 116 "${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc", 117 ] 118 119 external_deps = [ 120 "c_utils:utils", 121 "hilog:libhilog", 122 "init:libbegetutil", 123 "ipc:ipc_single", 124 "samgr:samgr_proxy", 125 ] 126 127 if (security_component_enhance_enable) { 128 cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] 129 } 130 131 subsystem_name = "security" 132 part_name = "access_token" 133} 134