1# Copyright (C) 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("//foundation/filemanagement/dfs_service/distributedfile.gni") 16 17group("cloud_adapter_example_target") { 18 deps = [] 19 if (!dfs_service_feature_enable_cloud_adapter) { 20 deps += [ 21 "${distributedfile_path}/adapter/cloud_adapter_example:cloud_adapter", 22 ] 23 } 24} 25 26config("public_config") { 27 include_dirs = 28 [ "${distributedfile_path}/adapter/cloud_adapter_example/include" ] 29} 30 31config("optimize-size") { 32 cflags = [ 33 "-fdata-sections", 34 "-ffunction-sections", 35 "-Oz", 36 ] 37 cflags_cc = [ 38 "-fvisibility-inlines-hidden", 39 "-Oz", 40 ] 41} 42 43ohos_shared_library("cloud_adapter") { 44 branch_protector_ret = "pac_ret" 45 configs = [ ":optimize-size" ] 46 sanitize = { 47 integer_overflow = true 48 ubsan = true 49 boundary_sanitize = true 50 cfi = true 51 cfi_cross_dso = true 52 debug = false 53 } 54 sources = [ 55 "${distributedfile_path}/adapter/cloud_adapter_example/src/cloud_asset_read_session_impl.cpp", 56 "${distributedfile_path}/adapter/cloud_adapter_example/src/cloud_assets_downloader_impl.cpp", 57 "${distributedfile_path}/adapter/cloud_adapter_example/src/cloud_database_impl.cpp", 58 "${distributedfile_path}/adapter/cloud_adapter_example/src/cloud_file_kit_impl.cpp", 59 "${distributedfile_path}/adapter/cloud_adapter_example/src/cloud_sync_helper_impl.cpp", 60 "${distributedfile_path}/adapter/cloud_adapter_example/src/data_sync_manager_impl.cpp", 61 ] 62 63 public_configs = [ ":public_config" ] 64 65 deps = [ 66 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 67 "${utils_path}:libdistributedfileutils", 68 ] 69 70 use_exceptions = true 71 part_name = "dfs_service" 72 subsystem_name = "filemanagement" 73} 74