1# Copyright (C) 2024-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("//build/ohos/ndk/ndk.gni") 16import("//foundation/filemanagement/file_api/file_api.gni") 17 18ohos_shared_library("ohfileio") { 19 sanitize = { 20 integer_overflow = true 21 ubsan = true 22 boundary_sanitize = true 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 } 27 cflags = [ 28 "-fvisibility=hidden", 29 "-fdata-sections", 30 "-ffunction-sections", 31 "-Oz", 32 ] 33 cflags_cc = [ 34 "-fvisibility-inlines-hidden", 35 "-Oz", 36 ] 37 include_dirs = [ 38 "./", 39 "../common/", 40 ] 41 42 sources = [ "./fileio.c" ] 43 deps = [ "${file_api_path}/interfaces/kits/native:fileio_native" ] 44 external_deps = [] 45 46 output_name = "ohfileio" 47 output_extension = "so" 48 relative_install_dir = "ndk" 49 part_name = "file_api" 50 subsystem_name = "filemanagement" 51} 52 53ohos_ndk_library("libohfileio") { 54 ndk_description_file = "./libfileio.ndk.json" 55 output_name = "ohfileio" 56 output_extension = "so" 57 system_capability = "SystemCapability.FileManagement.File.FileIO" 58} 59 60ohos_ndk_headers("oh_fileio_header") { 61 dest_dir = "$ndk_headers_out_dir/filemanagement/fileio/" 62 sources = [ "./fileio.h" ] 63} 64