• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//foundation/filemanagement/app_file_service/app_file_service.gni")
16import("//foundation/filemanagement/app_file_service/backup.gni")
17
18ohos_shared_library("cj_file_fileuri_ffi") {
19  branch_protector_ret = "pac_ret"
20  sanitize = {
21    integer_overflow = true
22    ubsan = true
23    boundary_sanitize = true
24    cfi = true
25    cfi_cross_dso = true
26    debug = false
27  }
28
29  include_dirs = [
30    "${app_file_service_path}/interfaces/innerkits/native/file_uri/include",
31    "src",
32  ]
33
34  if (!defined(defines)) {
35    defines = []
36  }
37
38  use_exceptions = true
39
40  if (product_name != "ohos-sdk") {
41    deps = [
42      "${app_file_service_path}/interfaces/innerkits/native:fileuri_native",
43      "${path_backup}/utils:backup_utils",
44    ]
45    external_deps = [
46      "ability_base:zuri",
47      "ability_runtime:abilitykit_native",
48      "bundle_framework:appexecfwk_base",
49      "bundle_framework:appexecfwk_core",
50      "c_utils:utils",
51      "file_api:filemgmt_libhilog",
52      "file_api:filemgmt_libn",
53      "hilog:libhilog",
54      "ipc:ipc_core",
55      "napi:cj_bind_ffi",
56      "napi:cj_bind_native",
57      "samgr:samgr_proxy",
58    ]
59    sources = [
60      "src/file_fileuri_ffi.cpp",
61      "src/file_uri.cpp",
62    ]
63  } else {
64    defines += [ "PREVIEWER" ]
65    sources = [ "src/fileuri_mock.cpp" ]
66  }
67
68  if (current_os == "ohos") {
69    defines += [ "OHOS_PLATFORM" ]
70  }
71
72  if (current_os == "mingw") {
73    defines += [ "WINDOWS_PLATFORM" ]
74  }
75
76  innerapi_tags = [ "platformsdk" ]
77  part_name = "app_file_service"
78  subsystem_name = "filemanagement"
79}
80
81ohos_shared_library("cj_file_grant_permission_ffi") {
82  branch_protector_ret = "pac_ret"
83  sanitize = {
84    integer_overflow = true
85    cfi = true
86    cfi_cross_dso = true
87    debug = false
88  }
89
90  include_dirs = [
91    "${app_file_service_path}/interfaces",
92    "${app_file_service_path}/interfaces/common/include",
93    "${app_file_service_path}/interfaces/innerkits/native/file_share/include",
94  ]
95
96  sources = [ "src/file_grant_permission_ffi.cpp" ]
97
98  deps = [
99    "${app_file_service_path}/interfaces/innerkits/native:fileshare_native",
100    "${app_file_service_path}/interfaces/innerkits/native:fileuri_native",
101  ]
102
103  external_deps = [
104    "ability_runtime:abilitykit_native",
105    "ability_runtime:extensionkit_native",
106    "ability_runtime:uri_permission_mgr",
107    "access_token:libaccesstoken_sdk",
108    "access_token:libtokenid_sdk",
109    "bundle_framework:appexecfwk_base",
110    "c_utils:utils",
111    "data_share:datashare_common",
112    "data_share:datashare_consumer",
113    "file_api:filemgmt_libhilog",
114    "file_api:filemgmt_libn",
115    "file_api:remote_uri_native",
116    "hilog:libhilog",
117    "init:libbegetutil",
118    "ipc:ipc_core",
119    "napi:ace_napi",
120    "napi:cj_bind_ffi",
121    "napi:cj_bind_native",
122  ]
123  defines = []
124
125  innerapi_tags = [ "platformsdk" ]
126  part_name = "app_file_service"
127  subsystem_name = "filemanagement"
128}
129