1# Copyright (c) 2021-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/ohos.gni") 15import("../../access_token.gni") 16 17config("accesstoken_common_cxx_public_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ "include" ] 20} 21 22action("permission_definition_parse") { 23 script = "permission_definition_parser.py" 24 args = [ 25 "--input-json", 26 rebase_path("${access_token_path}") + 27 "/services/accesstokenmanager/permission_definitions.json", 28 "--output-path", 29 rebase_path(target_out_dir) + "/permission_map_constant.h", 30 ] 31 outputs = [ "$target_out_dir" ] 32} 33 34ohos_shared_library("accesstoken_common_cxx") { 35 subsystem_name = "security" 36 innerapi_tags = [ 37 "platformsdk_indirect", 38 "chipsetsdk_indirect", 39 ] 40 part_name = "access_token" 41 sanitize = { 42 cfi = true 43 cfi_cross_dso = true 44 debug = false 45 } 46 branch_protector_ret = "pac_ret" 47 48 public_configs = [ ":accesstoken_common_cxx_public_config" ] 49 50 include_dirs = [ 51 "${access_token_path}/interfaces/innerkits/accesstoken/include", 52 "${access_token_path}/interfaces/innerkits/privacy/include", 53 "include", 54 rebase_path(target_out_dir), 55 ] 56 57 sources = [ 58 "src/constant_common.cpp", 59 "src/data_validator.cpp", 60 "src/permission_map.cpp", 61 "src/time_util.cpp", 62 ] 63 64 deps = [ ":permission_definition_parse" ] 65 external_deps = [ 66 "c_utils:utils", 67 "hilog:libhilog", 68 "init:libbegetutil", 69 ] 70 71 configs = [ 72 "${access_token_path}/config:access_token_compile_flags", 73 "${access_token_path}/config:coverage_flags", 74 ] 75 76 cflags_cc = [ "-DHILOG_ENABLE" ] 77} 78