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 = [ ":accesstoken" ] 45 46 include_dirs = [ 47 "${access_token_path}/frameworks/accesstoken/include", 48 "${access_token_path}/frameworks/common/include", 49 "src", 50 ] 51 52 sources = [ 53 "src/accesstoken_callback_stubs.cpp", 54 "src/accesstoken_callbacks.cpp", 55 "src/accesstoken_death_recipient.cpp", 56 "src/accesstoken_kit.cpp", 57 "src/accesstoken_manager_client.cpp", 58 "src/accesstoken_manager_proxy.cpp", 59 "src/perm_state_change_callback_customize.cpp", 60 ] 61 62 deps = [ 63 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 64 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 65 "${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc", 66 ] 67 68 external_deps = [ 69 "c_utils:utils", 70 "hilog:libhilog", 71 "init:libbegetutil", 72 "ipc:ipc_single", 73 "samgr:samgr_proxy", 74 ] 75 76 configs = [ 77 "${access_token_path}/config:access_token_compile_flags", 78 "${access_token_path}/config:coverage_flags", 79 ] 80 81 cflags_cc = [ 82 "-DHILOG_ENABLE", 83 "-DDEBUG_API_PERFORMANCE", 84 ] 85 86 if (build_variant == "user") { 87 cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ] 88 } 89 90 if (token_sync_enable == true) { 91 cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] 92 } 93 } 94} 95 96if (is_standard_system) { 97 ohos_shared_library("libtokenid_sdk") { 98 subsystem_name = "security" 99 part_name = "access_token" 100 sanitize = { 101 cfi = true 102 cfi_cross_dso = true 103 debug = false 104 } 105 branch_protector_ret = "pac_ret" 106 innerapi_tags = [ 107 "platformsdk", 108 "sasdk", 109 ] 110 111 output_name = "libtokenid_sdk" 112 public_configs = [ ":accesstoken" ] 113 114 include_dirs = [ "${access_token_path}/frameworks/common/include" ] 115 sources = [ "src/tokenid_kit.cpp" ] 116 117 deps = [] 118 external_deps = [ 119 "c_utils:utils", 120 "hilog:libhilog", 121 ] 122 123 configs = [ 124 "${access_token_path}/config:access_token_compile_flags", 125 "${access_token_path}/config:coverage_flags", 126 ] 127 cflags_cc = [ "-DHILOG_ENABLE" ] 128 if (security_component_enhance_enable == true) { 129 cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] 130 } 131 } 132} 133