# Copyright (c) 2021-2024 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("../../access_token.gni") config("accesstoken_service_common_public_config") { visibility = [ ":*" ] include_dirs = [ "app_manager/include", "database/include", "libraryloader/include", "random/include", ] if (eventhandler_enable) { include_dirs += [ "handler/include" ] } } ohos_static_library("accesstoken_service_common") { subsystem_name = "security" part_name = "access_token" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "${access_token_path}/frameworks/common/include", "${access_token_path}/interfaces/innerkits/accesstoken/include", ] public_configs = [ ":accesstoken_service_common_public_config" ] sources = [ "app_manager/src/ams_manager_access_proxy.cpp", "app_manager/src/app_manager_access_client.cpp", "app_manager/src/app_manager_access_proxy.cpp", "app_manager/src/app_manager_death_recipient.cpp", "app_manager/src/app_state_data.cpp", "app_manager/src/app_status_change_callback.cpp", "app_manager/src/process_data.cpp", "database/src/generic_values.cpp", "database/src/memory_guard.cpp", "database/src/sqlite_helper.cpp", "database/src/statement.cpp", "database/src/variant_value.cpp", "libraryloader/src/libraryloader.cpp", "random/src/random_openssl.cpp", ] cflags_cc = [ "-DHILOG_ENABLE", "-fvisibility=hidden", ] configs = [ "${access_token_path}/config:access_token_compile_flags", "${access_token_path}/config:coverage_flags", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "openssl:libcrypto_shared", "safwk:system_ability_fwk", "samgr:samgr_proxy", "sqlite:sqlite", ] if (eventhandler_enable == true) { cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] sources += [ "handler/src/access_event_handler.cpp" ] external_deps += [ "eventhandler:libeventhandler" ] } if (ability_base_enable == true) { include_dirs += [ "ability_manager/include" ] sources += [ "ability_manager/src/ability_manager_access_client.cpp", "ability_manager/src/ability_manager_access_death_recipient.cpp", "ability_manager/src/ability_manager_access_proxy.cpp", ] external_deps += [ "ability_base:want" ] } if (use_musl) { if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { cflags_cc += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ] } } } group("accesstoken_common") { if (is_standard_system) { deps = [ ":accesstoken_service_common", "ability_manager:accesstoken_ability_manager_adapter", "config_policy:accesstoken_config_policy", "screenlock_manager:accesstoken_screenlock_manager", ] } }