1# Copyright (C) 2024 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  sources = [ "./fileio.c" ]
40  deps = [ "${file_api_path}/interfaces/kits/native:fileio_native" ]
41  external_deps = []
42
43  output_name = "ohfileio"
44  output_extension = "so"
45  relative_install_dir = "ndk"
46  part_name = "file_api"
47  subsystem_name = "filemanagement"
48}
49
50ohos_ndk_library("libohfileio") {
51  ndk_description_file = "./libfileio.ndk.json"
52  output_name = "ohfileio"
53  output_extension = "so"
54  system_capability = "SystemCapability.FileManagement.File.FileIO"
55}
56
57ohos_ndk_headers("oh_fileio_header") {
58  dest_dir = "$ndk_headers_out_dir/filemanagement/fileio/"
59  sources = [ "./fileio.h" ]
60}
61