# Copyright (c) 2021-2022 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("../../os_account.gni") group("common_target") { deps = [ ":libaccount_common" ] } config("account_common_config") { include_dirs = [ "include", "file_operator/include", "log/include", "perf_stat/include", "${os_account_dfx_path}/hisysevent_adapter", "utils/include", "${innerkits_common}/include", ] } ohos_shared_library("libaccount_common") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "${os_account_dfx_path}/hisysevent_adapter/account_hisysevent_adapter.cpp", "account_error/src/account_error_no.cpp", "file_operator/src/account_file_operator.cpp", "log/src/account_log_wrapper.cpp", "perf_stat/src/perf_stat.cpp", "utils/src/account_permission_manager.cpp", "utils/src/account_timeout_task.cpp", "utils/src/memory_guard.cpp", ] cflags = [ "-pipe" ] cflags_cc = [ "-Wdate-time", "-Wformat=2", "-Wfloat-equal", "-Wshadow", ] defines = [ "ACCOUNT_LOG_TAG = \"AccountCommonFwk\"", "LOG_DOMAIN = 0xD001B00", ] if (use_musl) { if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] } } public_configs = [ ":account_common_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", ] public_external_deps = [ "json:nlohmann_json_static" ] if (build_selinux) { external_deps += [ "selinux_adapter:librestorecon" ] cflags += [ "-DWITH_SELINUX" ] } if (hicollie_enable == true) { sources += [ "utils/src/account_timer.cpp" ] external_deps += [ "hicollie:libhicollie" ] cflags_cc += [ "-DHICOLLIE_ENABLE" ] } subsystem_name = "account" innerapi_tags = [ "platformsdk" ] part_name = "os_account" }