# Copyright (c) 2021-2023 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") ohos_prebuilt_etc("token_sync.rc") { source = "token_sync.cfg" relative_install_dir = "init" subsystem_name = "security" part_name = "access_token" } group("tokensyncmanager") { if (is_standard_system && token_sync_enable == true) { deps = [ ":token_sync_manager_service", "sa_profile:tokensync_sa_profile_standard", ] } } if (token_sync_enable == true) { ohos_shared_library("token_sync_manager_service") { subsystem_name = "security" part_name = "access_token" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" if (!use_clang_coverage) { version_script = "tokensync_manager_service.map" shlib_type = "sa" } include_dirs = [ "include/service", "include/remote", "include/command", "include/common", "include/device", "include/protocol", "${access_token_path}/frameworks/common/include", "${access_token_path}/frameworks/accesstoken/include", "${access_token_path}/frameworks/tokensync/include", "${access_token_path}/interfaces/innerkits/accesstoken/include", "${access_token_path}/services/common/config_policy/include", "${access_token_path}/services/common/handler/include", "${access_token_path}/services/common/libraryloader/include", ] sources = [ "src/command/base_remote_command.cpp", "src/command/delete_remote_token_command.cpp", "src/command/sync_remote_hap_token_command.cpp", "src/command/update_remote_hap_token_command.cpp", "src/common/constant.cpp", "src/device/device_info_manager.cpp", "src/device/device_info_repository.cpp", "src/remote/remote_command_executor.cpp", "src/remote/remote_command_factory.cpp", "src/remote/remote_command_manager.cpp", "src/remote/soft_bus_channel.cpp", "src/remote/soft_bus_device_connection_listener.cpp", "src/remote/soft_bus_manager.cpp", "src/remote/soft_bus_socket_listener.cpp", "src/service/token_sync_manager_service.cpp", "src/service/token_sync_manager_stub.cpp", ] cflags_cc = [ "-DHILOG_ENABLE", "-DDEBUG_API_PERFORMANCE", "-fvisibility=hidden", ] if (build_variant == "user") { cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ] } configs = [ "${access_token_path}/config:access_token_compile_flags", "${access_token_path}/config:coverage_flags", ] deps = [ "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", "${access_token_path}/frameworks/common:accesstoken_common_cxx", "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", "${access_token_path}/interfaces/innerkits/token_setproc:libtoken_setproc", "${access_token_path}/services/common:accesstoken_service_common", "${access_token_path}/services/tokensyncmanager:token_sync.rc", ] external_deps = [ "c_utils:utils", "dsoftbus:softbus_client", "hilog:libhilog", "ipc:ipc_core", "json:nlohmann_json_static", "safwk:system_ability_fwk", "zlib:shared_libz", ] if (ohos_indep_compiler_enable) { external_deps += [ "bounds_checking_function:libsec_shared", "samgr:samgr_proxy", ] } if (eventhandler_enable == true) { cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] external_deps += [ "eventhandler:libeventhandler" ] } if (token_sync_enable == true) { cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] external_deps += [ "device_manager:devicemanagersdk" ] } } }