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