1# Copyright (c) 2022-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/file_api/file_api.gni") 16 17config("remote_uri_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "include", 21 "remote_uri", 22 ] 23} 24 25config("task_signal_config") { 26 visibility = [ ":*" ] 27 include_dirs = [ 28 "include", 29 "task_signal", 30 ] 31} 32 33ohos_shared_library("remote_uri_native") { 34 if (!use_mingw_win && !use_mac) { 35 cflags = [ 36 "-fdata-sections", 37 "-ffunction-sections", 38 "-Oz", 39 ] 40 cflags_cc = [ 41 "-fvisibility-inlines-hidden", 42 "-Oz", 43 ] 44 branch_protector_ret = "pac_ret" 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 } 54 55 sources = [ "remote_uri/remote_uri.cpp" ] 56 57 public_configs = [ ":remote_uri_config" ] 58 59 external_deps = [ 60 "ability_base:zuri", 61 "access_token:libaccesstoken_sdk", 62 "c_utils:utils", 63 "ipc:ipc_core", 64 ] 65 66 innerapi_tags = [ "platformsdk" ] 67 part_name = "file_api" 68 subsystem_name = "filemanagement" 69} 70 71ohos_shared_library("task_signal_native") { 72 if (!use_mingw_win && !use_mac) { 73 cflags = [ 74 "-fdata-sections", 75 "-ffunction-sections", 76 "-Oz", 77 ] 78 cflags_cc = [ 79 "-fvisibility-inlines-hidden", 80 "-Oz", 81 ] 82 branch_protector_ret = "pac_ret" 83 sanitize = { 84 integer_overflow = true 85 ubsan = true 86 boundary_sanitize = true 87 cfi = true 88 cfi_cross_dso = true 89 debug = false 90 } 91 92 sources = [ "task_signal/task_signal.cpp" ] 93 94 public_configs = [ ":task_signal_config" ] 95 96 deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ] 97 98 external_deps = [ 99 "ability_runtime:abilitykit_native", 100 "c_utils:utils", 101 "dfs_service:distributed_file_daemon_kit_inner", 102 "hilog:libhilog", 103 ] 104 105 innerapi_tags = [ "platformsdk" ] 106 part_name = "file_api" 107 subsystem_name = "filemanagement" 108 } 109} 110 111config("environment_config") { 112 visibility = [ ":*" ] 113 include_dirs = [ "environment" ] 114} 115 116ohos_shared_library("environment_native") { 117 branch_protector_ret = "pac_ret" 118 sanitize = { 119 integer_overflow = true 120 ubsan = true 121 boundary_sanitize = true 122 cfi = true 123 cfi_cross_dso = true 124 debug = false 125 } 126 cflags = [ 127 "-fdata-sections", 128 "-ffunction-sections", 129 "-Oz", 130 ] 131 cflags_cc = [ 132 "-fvisibility-inlines-hidden", 133 "-Oz", 134 ] 135 sources = [ "environment/environment_native.cpp" ] 136 public_configs = [ ":environment_config" ] 137 138 deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ] 139 140 external_deps = [ 141 "access_token:libaccesstoken_sdk", 142 "access_token:libtokenid_sdk", 143 "bounds_checking_function:libsec_shared", 144 "hilog:libhilog", 145 "init:libbegetutil", 146 "ipc:ipc_core", 147 "napi:ace_napi", 148 ] 149 innerapi_tags = [ "platformsdk" ] 150 part_name = "file_api" 151 subsystem_name = "filemanagement" 152} 153 154config("fileio_config") { 155 visibility = [ ":*" ] 156 include_dirs = [ "fileio" ] 157} 158 159ohos_shared_library("fileio_native") { 160 branch_protector_ret = "pac_ret" 161 sanitize = { 162 integer_overflow = true 163 ubsan = true 164 boundary_sanitize = true 165 cfi = true 166 cfi_cross_dso = true 167 debug = false 168 } 169 cflags = [ 170 "-fvisibility=hidden", 171 "-fdata-sections", 172 "-ffunction-sections", 173 "-Oz", 174 ] 175 cflags_cc = [ 176 "-fvisibility-inlines-hidden", 177 "-Oz", 178 ] 179 sources = [ "fileio/fileio_native.cpp" ] 180 181 public_configs = [ ":fileio_config" ] 182 183 deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ] 184 185 external_deps = [ 186 "ability_base:zuri", 187 "app_file_service:fileuri_native", 188 "bounds_checking_function:libsec_shared", 189 "c_utils:utils", 190 "hilog:libhilog", 191 ] 192 innerapi_tags = [ "platformsdk" ] 193 part_name = "file_api" 194 subsystem_name = "filemanagement" 195} 196 197group("build_kits_native") { 198 deps = [ 199 ":environment_native", 200 ":fileio_native", 201 ":remote_uri_native", 202 ":task_signal_native", 203 ] 204} 205