1# Copyright (c) 2021 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/app_file_service/app_file_service.gni") 16import("//foundation/filemanagement/app_file_service/backup.gni") 17 18ohos_shared_library("fileshare") { 19 branch_protector_ret = "pac_ret" 20 sanitize = { 21 integer_overflow = true 22 cfi = true 23 cfi_cross_dso = true 24 debug = false 25 } 26 27 include_dirs = [ 28 ".", 29 "../../common/include", 30 "${app_file_service_path}/interfaces/innerkits/native/file_share/include", 31 ] 32 33 sources = [ 34 "../../common/src/json_utils.cpp", 35 "../../common/src/sandbox_helper.cpp", 36 "../../innerkits/native/file_share/src/file_permission.cpp", 37 "file_share/fileshare_n_exporter.cpp", 38 "file_share/grant_permissions.cpp", 39 "file_share/grant_uri_permission.cpp", 40 ] 41 42 deps = 43 [ "${app_file_service_path}/interfaces/innerkits/native:fileuri_native" ] 44 45 external_deps = [ 46 "ability_base:want", 47 "ability_base:zuri", 48 "ability_runtime:abilitykit_native", 49 "ability_runtime:extensionkit_native", 50 "ability_runtime:uri_permission_mgr", 51 "access_token:libaccesstoken_sdk", 52 "access_token:libtokenid_sdk", 53 "bundle_framework:appexecfwk_base", 54 "c_utils:utils", 55 "common_event_service:cesfwk_innerkits", 56 "data_share:datashare_common", 57 "data_share:datashare_consumer", 58 "file_api:filemgmt_libhilog", 59 "file_api:filemgmt_libn", 60 "file_api:remote_uri_native", 61 "hilog:libhilog", 62 "init:libbegetutil", 63 "ipc:ipc_core", 64 "napi:ace_napi", 65 ] 66 defines = [] 67 if (sandbox_manarer) { 68 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 69 defines += [ 70 "SANDBOX_MANAGER", 71 "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER", 72 ] 73 } 74 relative_install_dir = "module" 75 76 part_name = "app_file_service" 77 subsystem_name = "filemanagement" 78} 79 80ohos_shared_library("fileuri") { 81 branch_protector_ret = "pac_ret" 82 sanitize = { 83 integer_overflow = true 84 cfi = true 85 cfi_cross_dso = true 86 debug = false 87 } 88 89 include_dirs = [ 90 ".", 91 "../../common/include", 92 "${app_file_service_path}/interfaces/innerkits/native/file_uri/include", 93 ] 94 95 sources = [ 96 "../../common/src/common_func.cpp", 97 "../../common/src/sandbox_helper.cpp", 98 "file_uri/file_uri_n_exporter.cpp", 99 "file_uri/get_uri_from_path.cpp", 100 "file_uri/module.cpp", 101 "file_uri/prop_n_exporter.cpp", 102 ] 103 104 deps = 105 [ "${app_file_service_path}/interfaces/innerkits/native:fileuri_native" ] 106 107 external_deps = [ 108 "ability_base:zuri", 109 "ability_runtime:abilitykit_native", 110 "bundle_framework:appexecfwk_base", 111 "bundle_framework:appexecfwk_core", 112 "c_utils:utils", 113 "file_api:filemgmt_libhilog", 114 "file_api:filemgmt_libn", 115 "hilog:libhilog", 116 "ipc:ipc_core", 117 "napi:ace_napi", 118 "samgr:samgr_proxy", 119 ] 120 121 use_exceptions = true 122 123 relative_install_dir = "module/file" 124 125 part_name = "app_file_service" 126 subsystem_name = "filemanagement" 127} 128 129ohos_shared_library("backup") { 130 branch_protector_ret = "pac_ret" 131 sanitize = { 132 integer_overflow = true 133 cfi = true 134 cfi_cross_dso = true 135 debug = false 136 } 137 138 relative_install_dir = "module/file" 139 subsystem_name = "filemanagement" 140 part_name = "app_file_service" 141 142 include_dirs = [ "${path_napi}/interfaces/kits" ] 143 144 defines = [ 145 "LOG_DOMAIN=0xD004306", 146 "LOG_TAG=\"BackupNAPI\"", 147 ] 148 149 sources = [ 150 "${path_backup_js}/backup/general_callbacks.cpp", 151 "${path_backup_js}/backup/module.cpp", 152 "${path_backup_js}/backup/parse_inc_info_from_js.cpp", 153 "${path_backup_js}/backup/prop_n_exporter.cpp", 154 "${path_backup_js}/backup/prop_n_operation.cpp", 155 "${path_backup_js}/backup/session_backup_n_exporter.cpp", 156 "${path_backup_js}/backup/session_incremental_backup_n_exporter.cpp", 157 "${path_backup_js}/backup/session_restore_n_exporter.cpp", 158 ] 159 160 deps = [ 161 "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner", 162 "${path_backup}/utils:backup_utils", 163 "${path_jsoncpp}:jsoncpp", 164 ] 165 166 cflags_cc = [ 167 "-fdata-sections", 168 "-ffunction-sections", 169 "-fno-unwind-tables", 170 "-fno-asynchronous-unwind-tables", 171 "-Os", 172 ] 173 174 external_deps = [ 175 "access_token:libaccesstoken_sdk", 176 "access_token:libtokenid_sdk", 177 "c_utils:utils", 178 "file_api:filemgmt_libhilog", 179 "file_api:filemgmt_libn", 180 "hilog:libhilog", 181 "ipc:ipc_core", 182 "napi:ace_napi", 183 "samgr:samgr_proxy", 184 ] 185} 186