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_service_common_public_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "app_manager/include", 21 "dfx/include", 22 "database/include", 23 "libraryloader/include", 24 "random/include", 25 ] 26 if (eventhandler_enable) { 27 include_dirs += [ "handler/include" ] 28 } 29} 30 31ohos_static_library("accesstoken_service_common") { 32 subsystem_name = "security" 33 part_name = "access_token" 34 sanitize = { 35 cfi = true 36 cfi_cross_dso = true 37 debug = false 38 } 39 branch_protector_ret = "pac_ret" 40 include_dirs = [ 41 "${access_token_path}/frameworks/common/include", 42 "${access_token_path}/interfaces/innerkits/accesstoken/include", 43 ] 44 45 public_configs = [ ":accesstoken_service_common_public_config" ] 46 47 sources = [ 48 "app_manager/src/app_manager_access_client.cpp", 49 "app_manager/src/app_state_data.cpp", 50 "app_manager/src/app_status_change_callback.cpp", 51 "app_manager/src/process_data.cpp", 52 "database/src/generic_values.cpp", 53 "database/src/memory_guard.cpp", 54 "database/src/sqlite_helper.cpp", 55 "database/src/statement.cpp", 56 "database/src/variant_value.cpp", 57 "dfx/src/data_usage_dfx.cpp", 58 "libraryloader/src/libraryloader.cpp", 59 "random/src/random_dev_urandom.cpp", 60 "random/src/random_openssl.cpp", 61 ] 62 63 cflags_cc = [ 64 "-DHILOG_ENABLE", 65 "-fvisibility=hidden", 66 ] 67 configs = [ 68 "${access_token_path}/config:access_token_compile_flags", 69 "${access_token_path}/config:coverage_flags", 70 ] 71 72 external_deps = [ 73 "c_utils:utils", 74 "hilog:libhilog", 75 "hisysevent:libhisysevent", 76 "ipc:ipc_single", 77 "openssl:libcrypto_shared", 78 "safwk:system_ability_fwk", 79 "samgr:samgr_proxy", 80 "sqlite:sqlite", 81 ] 82 if (eventhandler_enable == true) { 83 cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] 84 sources += [ "handler/src/access_event_handler.cpp" ] 85 external_deps += [ "eventhandler:libeventhandler" ] 86 } 87 88 if (use_musl) { 89 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 90 cflags_cc += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ] 91 } 92 } 93} 94 95group("accesstoken_common") { 96 if (is_standard_system) { 97 deps = [ 98 ":accesstoken_service_common", 99 "ability_manager:accesstoken_ability_manager_adapter", 100 "json_parse:accesstoken_json_parse", 101 "screenlock_manager:accesstoken_screenlock_manager", 102 ] 103 } 104} 105