1# Copyright (C) 2023-2025 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("optimize-size") { 18 cflags = [ 19 "-fdata-sections", 20 "-ffunction-sections", 21 "-Oz", 22 ] 23 cflags_cc = [ 24 "-fvisibility-inlines-hidden", 25 "-Oz", 26 ] 27} 28 29ohos_shared_library("cloudfiledaemon") { 30 branch_protector_ret = "pac_ret" 31 configs = [ ":optimize-size" ] 32 sanitize = { 33 integer_overflow = true 34 ubsan = true 35 boundary_sanitize = true 36 cfi = true 37 cfi_cross_dso = true 38 debug = false 39 } 40 cloud_disk = [ 41 "src/cloud_disk/database_manager.cpp", 42 "src/cloud_disk/file_operations_base.cpp", 43 "src/cloud_disk/file_operations_cloud.cpp", 44 "src/cloud_disk/file_operations_helper.cpp", 45 "src/cloud_disk/file_operations_local.cpp", 46 "src/cloud_disk/fuse_operations.cpp", 47 "src/cloud_disk/account_status.cpp", 48 "src/cloud_disk/account_status_listener.cpp", 49 "src/cloud_disk/io_message_listener.cpp", 50 "src/cloud_disk/appstate_observer.cpp", 51 ] 52 53 sources = [ 54 "src/fuse_manager/cloud_daemon_statistic.cpp", 55 "src/fuse_manager/fuse_manager.cpp", 56 "src/ipc/cloud_daemon.cpp", 57 "src/ipc/cloud_daemon_stub.cpp", 58 "src/utils/setting_data_helper.cpp", 59 ] 60 61 sources += cloud_disk 62 63 configs += [ "${utils_path}:compiler_configs" ] 64 65 defines = [ "LOG_TAG=\"CloudFileDaemon\"" ] 66 67 include_dirs = [ 68 "include", 69 "${utils_path}/cloud_disk/include", 70 "${utils_path}/dentry/include", 71 "${utils_path}/log/include", 72 "${utils_path}/ioctl/include", 73 "${utils_path}/system/include", 74 "${innerkits_native_path}/cloud_daemon_kit_inner", 75 "${innerkits_native_path}/cloud_file_kit_inner", 76 "${innerkits_native_path}/cloud_file_kit_inner/big_data_statistics", 77 "${services_path}/cloudfiledaemon/include/cloud_disk/", 78 "${services_path}/cloudfiledaemon/include/fuse_manager/", 79 "${services_path}/cloudfiledaemon/include/ipc/", 80 "${services_path}/cloudfiledaemon/include/utils/", 81 "${services_path}/cloudsyncservice/include/data_sync/", 82 "${clouddisk_database_path}/include", 83 ] 84 85 deps = [ 86 "${clouddisk_database_path}:clouddisk_database", 87 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit_core", 88 "${utils_path}:libdistributedfileutils_lite", 89 ] 90 91 external_deps = [ 92 "ability_base:want", 93 "ability_runtime:dataobs_manager", 94 "c_utils:utils", 95 "common_event_service:cesfwk_innerkits", 96 "data_share:datashare_consumer", 97 "ffrt:libffrt", 98 "hilog:libhilog", 99 "hisysevent:libhisysevent", 100 "hitrace:hitrace_meter", 101 "init:libbegetutil", 102 "ipc:ipc_single", 103 "libfuse:libfuse", 104 "relational_store:native_rdb", 105 "safwk:system_ability_fwk", 106 "samgr:samgr_proxy", 107 "ability_runtime:app_manager" 108 ] 109 110 if (cloudsync_service_hicollie_enable) { 111 external_deps += [ "hicollie:libhicollie" ] 112 defines += [ "HICOLLIE_ENABLE" ] 113 } 114 115 use_exceptions = true 116 part_name = "dfs_service" 117 subsystem_name = "filemanagement" 118} 119