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("../../os_account.gni") 16 17group("common_target") { 18 deps = [ ":libaccount_common" ] 19} 20 21config("account_common_config") { 22 include_dirs = [ 23 "include", 24 "file_operator/include", 25 "log/include", 26 "perf_stat/include", 27 "${os_account_dfx_path}/hisysevent_adapter", 28 "utils/include", 29 "${innerkits_common}/include", 30 "${innerkits_path}/include", 31 ] 32} 33 34ohos_shared_library("libaccount_common") { 35 branch_protector_ret = "pac_ret" 36 37 sanitize = { 38 cfi = true 39 cfi_cross_dso = true 40 debug = false 41 } 42 43 sources = [ 44 "${innerkits_native_path}/src/distributed_account_subscribe_callback.cpp", 45 "${os_account_dfx_path}/hisysevent_adapter/account_hisysevent_adapter.cpp", 46 "account_error/src/account_error_no.cpp", 47 "file_operator/src/account_file_operator.cpp", 48 "log/src/account_log_wrapper.cpp", 49 "perf_stat/src/perf_stat.cpp", 50 "utils/src/account_permission_manager.cpp", 51 "utils/src/account_timeout_task.cpp", 52 "utils/src/memory_guard.cpp", 53 ] 54 55 cflags = [ "-pipe" ] 56 cflags_cc = [ 57 "-Wdate-time", 58 "-Wformat=2", 59 "-Wfloat-equal", 60 "-Wshadow", 61 ] 62 63 defines = [ 64 "ACCOUNT_LOG_TAG = \"AccountCommonFwk\"", 65 "LOG_DOMAIN = 0xD001B00", 66 ] 67 68 if (use_musl) { 69 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 70 defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] 71 } 72 } 73 74 public_configs = [ ":account_common_config" ] 75 76 external_deps = [ 77 "access_token:libaccesstoken_sdk", 78 "access_token:libtokenid_sdk", 79 "c_utils:utils", 80 "hilog:libhilog", 81 "ipc:ipc_single", 82 ] 83 84 public_external_deps = [ "json:nlohmann_json_static" ] 85 86 if (hicollie_enable == true) { 87 sources += [ "utils/src/account_timer.cpp" ] 88 external_deps += [ "hicollie:libhicollie" ] 89 cflags_cc += [ "-DHICOLLIE_ENABLE" ] 90 } 91 92 if (os_account_distributed_feature) { 93 cflags_cc += [ "-DENABLE_FILE_WATCHER" ] 94 } 95 96 if (has_hiviewdfx_hitrace_part) { 97 cflags_cc += [ "-DHAS_HISYSEVENT_PART" ] 98 external_deps += [ "hisysevent:libhisysevent" ] 99 } 100 101 subsystem_name = "account" 102 innerapi_tags = [ "platformsdk" ] 103 part_name = "os_account" 104} 105