1# Copyright (C) 2022 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("//foundation/filemanagement/dfs_service/distributedfile.gni") 16 17config("public_config") { 18 include_dirs = [ "." ] 19} 20 21config("private_config") { 22 include_dirs = [ 23 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 24 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 25 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 26 "${distributedfile_path}/utils/log/include", 27 ] 28} 29 30config("optimize-size") { 31 cflags = [ 32 "-fdata-sections", 33 "-ffunction-sections", 34 "-Oz", 35 ] 36 cflags_cc = [ 37 "-fvisibility-inlines-hidden", 38 "-Oz", 39 ] 40} 41 42ohos_shared_library("cloudsync_kit_inner") { 43 branch_protector_ret = "pac_ret" 44 configs = [ ":optimize-size" ] 45 sanitize = { 46 integer_overflow = true 47 ubsan = true 48 boundary_sanitize = true 49 cfi = true 50 cfi_cross_dso = true 51 debug = false 52 } 53 sources = [ 54 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_client.cpp", 55 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_stub.cpp", 56 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", 57 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_client.cpp", 58 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_stub.cpp", 59 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_client.cpp", 60 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_stub.cpp", 61 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp", 62 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_manager.cpp", 63 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_manager_impl.cpp", 64 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_service_proxy.cpp", 65 "${distributedfile_path}/utils/log/src/utils_log.cpp", 66 ] 67 68 defines = [ 69 "LOG_DOMAIN=0xD004308", 70 "LOG_TAG=\"CLOUDSYNC_API\"", 71 ] 72 73 configs += [ ":private_config" ] 74 public_configs = [ ":public_config" ] 75 76 external_deps = [ 77 "ability_base:zuri", 78 "ability_runtime:ability_manager", 79 "ability_runtime:dataobs_manager", 80 "c_utils:utils", 81 "hilog:libhilog", 82 "ipc:ipc_single", 83 "safwk:system_ability_fwk", 84 "samgr:samgr_proxy", 85 ] 86 87 deps = [ "${utils_path}:libdistributedfiledentry" ] 88 89 if (cloudsync_service_media_library) { 90 external_deps += [ "media_library:media_library" ] 91 defines += [ "SUPPORT_MEDIA_LIBRARY" ] 92 } 93 94 use_exceptions = true 95 part_name = "dfs_service" 96 subsystem_name = "filemanagement" 97} 98 99ohos_shared_library("cloudsync_asset_kit_inner") { 100 branch_protector_ret = "pac_ret" 101 configs = [ ":optimize-size" ] 102 sanitize = { 103 integer_overflow = true 104 ubsan = true 105 boundary_sanitize = true 106 cfi = true 107 cfi_cross_dso = true 108 debug = false 109 } 110 sources = [ 111 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", 112 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager.cpp", 113 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager_impl.cpp", 114 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp", 115 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_service_proxy.cpp", 116 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_client.cpp", 117 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_stub.cpp", 118 ] 119 120 defines = [ 121 "LOG_DOMAIN=0xD004309", 122 "LOG_TAG=\"CLOUD_ASSET_API\"", 123 ] 124 125 configs += [ ":private_config" ] 126 public_configs = [ ":public_config" ] 127 128 external_deps = [ 129 "ability_base:zuri", 130 "c_utils:utils", 131 "hilog:libhilog", 132 "ipc:ipc_single", 133 "safwk:system_ability_fwk", 134 "samgr:samgr_proxy", 135 ] 136 137 deps = [ "${utils_path}:libdistributedfileutils_lite" ] 138 139 use_exceptions = true 140 innerapi_tags = [ "platformsdk" ] 141 part_name = "dfs_service" 142 subsystem_name = "filemanagement" 143} 144 145ohos_shared_library("cloudsync_kit_inner_lite") { 146 branch_protector_ret = "pac_ret" 147 configs = [ ":optimize-size" ] 148 sanitize = { 149 integer_overflow = true 150 ubsan = true 151 boundary_sanitize = true 152 cfi = true 153 cfi_cross_dso = true 154 debug = false 155 cfi_vcall_icall_only = true 156 } 157 sources = [ 158 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 159 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 160 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_service_proxy_lite.cpp", 161 ] 162 163 defines = [ 164 "LOG_DOMAIN=0xD004308", 165 "LOG_TAG=\"CloudFileDaemon\"", 166 ] 167 168 configs += [ ":private_config" ] 169 public_configs = [ ":public_config" ] 170 171 external_deps = [ 172 "c_utils:utils", 173 "hilog:libhilog", 174 "ipc:ipc_single", 175 "safwk:system_ability_fwk", 176 "samgr:samgr_proxy", 177 ] 178 179 deps = [ "${utils_path}:libdistributedfileutils_lite" ] 180 181 use_exceptions = true 182 innerapi_tags = [ "platformsdk" ] 183 part_name = "dfs_service" 184 subsystem_name = "filemanagement" 185} 186