• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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
17ohos_prebuilt_etc("token_sync.rc") {
18  source = "token_sync.cfg"
19  relative_install_dir = "init"
20  subsystem_name = "security"
21  part_name = "access_token"
22}
23
24group("tokensyncmanager") {
25  if (is_standard_system && token_sync_enable == true) {
26    deps = [
27      ":token_sync_manager_service",
28      "${access_token_path}/interfaces/innerkits/tokensync:libtokensync_sdk",
29      "sa_profile:tokensync_sa_profile_standard",
30    ]
31  }
32}
33
34if (token_sync_enable == true) {
35  ohos_shared_library("token_sync_manager_service") {
36    subsystem_name = "security"
37    part_name = "access_token"
38    sanitize = {
39      cfi = true
40      cfi_cross_dso = true
41      debug = false
42    }
43    branch_protector_ret = "pac_ret"
44
45    if (!use_clang_coverage) {
46      version_script = "tokensync_manager_service.map"
47    }
48
49    include_dirs = [
50      "include/service",
51      "include/remote",
52      "include/command",
53      "include/common",
54      "include/device",
55      "include/protocol",
56      "${access_token_path}/frameworks/common/include",
57      "${access_token_path}/frameworks/accesstoken/include",
58      "${access_token_path}/frameworks/tokensync/include",
59      "${access_token_path}/interfaces/innerkits/accesstoken/include",
60      "${access_token_path}/services/common/handler/include",
61    ]
62
63    sources = [
64      "src/command/base_remote_command.cpp",
65      "src/command/delete_remote_token_command.cpp",
66      "src/command/sync_remote_hap_token_command.cpp",
67      "src/command/sync_remote_native_token_command.cpp",
68      "src/command/update_remote_hap_token_command.cpp",
69      "src/common/constant.cpp",
70      "src/device/device_info_manager.cpp",
71      "src/device/device_info_repository.cpp",
72      "src/remote/remote_command_executor.cpp",
73      "src/remote/remote_command_factory.cpp",
74      "src/remote/remote_command_manager.cpp",
75      "src/remote/soft_bus_channel.cpp",
76      "src/remote/soft_bus_device_connection_listener.cpp",
77      "src/remote/soft_bus_manager.cpp",
78      "src/remote/soft_bus_socket_listener.cpp",
79      "src/service/token_sync_manager_service.cpp",
80      "src/service/token_sync_manager_stub.cpp",
81    ]
82
83    cflags_cc = [
84      "-DHILOG_ENABLE",
85      "-DDEBUG_API_PERFORMANCE",
86    ]
87
88    if (build_variant == "user") {
89      cflags_cc += [ "-DATM_BUILD_VARIANT_USER_ENABLE" ]
90    }
91
92    configs = [ "${access_token_path}/config:coverage_flags" ]
93
94    deps = [
95      "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx",
96      "${access_token_path}/frameworks/common:accesstoken_common_cxx",
97      "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
98      "${access_token_path}/services/common:accesstoken_service_common",
99      "${access_token_path}/services/tokensyncmanager:token_sync.rc",
100      "//third_party/zlib:shared_libz",
101    ]
102
103    external_deps = [
104      "c_utils:utils",
105      "dsoftbus:softbus_client",
106      "hilog:libhilog",
107      "ipc:ipc_core",
108      "safwk:system_ability_fwk",
109    ]
110    if (eventhandler_enable == true) {
111      cflags_cc += [ "-DEVENTHANDLER_ENABLE" ]
112      external_deps += [ "eventhandler:libeventhandler" ]
113    }
114
115    if (token_sync_enable == true) {
116      cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ]
117      external_deps += [ "device_manager:devicemanagersdk" ]
118    }
119    if (!use_clang_coverage) {
120      shlib_type = "sa"
121    }
122  }
123}
124