# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("../../../access_token.gni") config("accesstoken") { visibility = [ ":*" ] include_dirs = [ "include" ] } if (is_standard_system) { ohos_shared_library("libaccesstoken_sdk") { subsystem_name = "security" part_name = "access_token" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" innerapi_tags = [ "chipsetsdk", "platformsdk", "sasdk", ] if (!use_clang_coverage) { version_script = "libaccesstoken_sdk.map" } output_name = "libaccesstoken_sdk" public_configs = [ ":accesstoken" ] include_dirs = [ "${access_token_path}/frameworks/accesstoken/include", "${access_token_path}/frameworks/common/include", "${access_token_path}/interfaces/innerkits/token_setproc/include", "src", ] sources = [ "src/accesstoken_death_recipient.cpp", "src/accesstoken_kit.cpp", "src/accesstoken_manager_client.cpp", "src/accesstoken_manager_proxy.cpp", "src/perm_state_change_callback_customize.cpp", "src/permission_state_change_callback.cpp", "src/permission_state_change_callback_stub.cpp", ] deps = [ ":libtokenid_sdk", "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", "${access_token_path}/frameworks/common:accesstoken_common_cxx", "${access_token_path}/interfaces/innerkits/token_setproc:libperm_setproc", "${access_token_path}/interfaces/innerkits/token_setproc:libtoken_setproc", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_single", "samgr:samgr_proxy", ] configs = [ "${access_token_path}/config:coverage_flags" ] cflags_cc = [ "-DHILOG_ENABLE", "-DDEBUG_API_PERFORMANCE", ] if (build_variant == "user") { cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ] } if (token_sync_enable == true) { cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] } } } if (is_standard_system) { ohos_shared_library("libtokenid_sdk") { subsystem_name = "security" part_name = "access_token" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" innerapi_tags = [ "platformsdk", "sasdk", ] output_name = "libtokenid_sdk" public_configs = [ ":accesstoken" ] include_dirs = [ "${access_token_path}/frameworks/common/include" ] sources = [ "src/tokenid_kit.cpp" ] deps = [] external_deps = [ "c_utils:utils", "hilog:libhilog", ] configs = [ "${access_token_path}/config:coverage_flags" ] cflags_cc = [ "-DHILOG_ENABLE" ] if (security_component_enhance_enable == true) { cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] } } }