1# Copyright (c) 2022-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("//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      "c_utils:utils",
100      "dfs_service:distributed_file_daemon_kit_inner",
101      "hilog:libhilog",
102    ]
103
104    innerapi_tags = [ "platformsdk" ]
105    part_name = "file_api"
106    subsystem_name = "filemanagement"
107  }
108}
109
110config("environment_config") {
111  visibility = [ ":*" ]
112  include_dirs = [ "environment" ]
113}
114
115ohos_shared_library("environment_native") {
116  branch_protector_ret = "pac_ret"
117  sanitize = {
118    integer_overflow = true
119    ubsan = true
120    boundary_sanitize = true
121    cfi = true
122    cfi_cross_dso = true
123    debug = false
124  }
125  cflags = [
126    "-fdata-sections",
127    "-ffunction-sections",
128    "-Oz",
129  ]
130  cflags_cc = [
131    "-fvisibility-inlines-hidden",
132    "-Oz",
133  ]
134  sources = [ "environment/environment_native.cpp" ]
135  public_configs = [ ":environment_config" ]
136
137  deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ]
138
139  external_deps = [
140    "access_token:libaccesstoken_sdk",
141    "access_token:libtokenid_sdk",
142    "bounds_checking_function:libsec_shared",
143    "hilog:libhilog",
144    "init:libbegetutil",
145    "ipc:ipc_core",
146    "napi:ace_napi",
147  ]
148  innerapi_tags = [ "platformsdk" ]
149  part_name = "file_api"
150  subsystem_name = "filemanagement"
151}
152
153config("fileio_config") {
154  visibility = [ ":*" ]
155  include_dirs = [ "fileio" ]
156}
157
158ohos_shared_library("fileio_native") {
159  branch_protector_ret = "pac_ret"
160  sanitize = {
161    integer_overflow = true
162    ubsan = true
163    boundary_sanitize = true
164    cfi = true
165    cfi_cross_dso = true
166    debug = false
167  }
168  cflags = [
169    "-fvisibility=hidden",
170    "-fdata-sections",
171    "-ffunction-sections",
172    "-Oz",
173  ]
174  cflags_cc = [
175    "-fvisibility-inlines-hidden",
176    "-Oz",
177  ]
178  sources = [ "fileio/fileio_native.cpp" ]
179
180  public_configs = [ ":fileio_config" ]
181
182  deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ]
183
184  external_deps = [
185    "ability_base:zuri",
186    "app_file_service:fileuri_native",
187    "bounds_checking_function:libsec_shared",
188    "hilog:libhilog",
189  ]
190  innerapi_tags = [ "platformsdk" ]
191  part_name = "file_api"
192  subsystem_name = "filemanagement"
193}
194
195group("build_kits_native") {
196  deps = [
197    ":environment_native",
198    ":fileio_native",
199    ":remote_uri_native",
200    ":task_signal_native",
201  ]
202}
203