• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/dfs_service/distributedfile.gni")
16
17config("compiler_configs") {
18  visibility = [ ":*" ]
19  visibility += [
20    "${distributedfile_path}/services/*",
21    "${distributedfile_path}/test/moduletest/*",
22  ]
23
24  cflags = [
25    "-Wall",
26    "-Werror",
27    "-Wdate-time",
28    "-Wfloat-equal",
29    "-Wshadow",
30    "-Wformat=2",
31    "-fvisibility=hidden",
32    "-ffunction-sections",
33    "-Os",
34  ]
35  configs = [ "//build/config/compiler:exceptions" ]
36
37  cflags_cc = [
38    "-fvisibility-inlines-hidden",
39    "-Os",
40  ]
41
42  defines = [
43    "LOG_DOMAIN=0xD001600",
44    "LOG_LEVEL=INFO",
45  ]
46}
47
48config("utils_public_config") {
49  include_dirs = [
50    "cloud_disk/include",
51    "dfx/include",
52    "work/include",
53    "log/include",
54    "preference/include",
55    "system/include",
56  ]
57}
58
59ohos_shared_library("libdistributedfileutils") {
60  branch_protector_ret = "pac_ret"
61  sanitize = {
62    ubsan = true
63    boundary_sanitize = true
64    cfi = true
65    cfi_cross_dso = true
66    debug = false
67  }
68  sources = [
69    "cloud_disk/src/cloud_file_utils.cpp",
70    "dfx/src/xcollie_helper.cpp",
71    "log/src/dfs_error.cpp",
72    "log/src/utils_log.cpp",
73    "preference/src/cloud_pref_impl.cpp",
74    "system/src/dfsu_access_token_helper.cpp",
75    "system/src/dfsu_fd_guard.cpp",
76    "system/src/dfsu_memory_guard.cpp",
77    "system/src/dfsu_mount_argument_descriptors.cpp",
78    "system/src/dfsu_timer.cpp",
79    "system/src/utils_directory.cpp",
80    "work/src/async_work.cpp",
81  ]
82
83  configs = [ "//build/config/compiler:exceptions" ]
84  public_configs = [ ":utils_public_config" ]
85
86  defines = [
87    "LOG_DOMAIN=0xD004308",
88    "LOG_TAG=\"distributedfile_utils\"",
89  ]
90
91  if (use_musl) {
92    if (use_jemalloc && use_jemalloc_dfx_intf) {
93      defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
94    }
95  }
96
97  external_deps = [
98    "ability_base:want",
99    "ability_base:zuri",
100    "ability_runtime:uri_permission_mgr",
101    "access_token:libaccesstoken_sdk",
102    "access_token:libtokenid_sdk",
103    "c_utils:utils",
104    "c_utils:utilsbase",
105    "file_api:filemgmt_libhilog",
106    "file_api:filemgmt_libn",
107    "hilog:libhilog",
108    "ipc:ipc_core",
109    "napi:ace_napi",
110    "preferences:native_preferences",
111  ]
112
113  if (cloudsync_service_hicollie_enable) {
114    external_deps += [ "hicollie:libhicollie" ]
115    defines += [ "HICOLLIE_ENABLE" ]
116  }
117
118  part_name = "dfs_service"
119  innerapi_tags = [ "platformsdk" ]
120  subsystem_name = "filemanagement"
121}
122
123config("dentry_public_config") {
124  include_dirs = [ "dentry/include" ]
125}
126
127ohos_shared_library("libdistributedfiledentry") {
128  branch_protector_ret = "pac_ret"
129  sanitize = {
130    ubsan = true
131    boundary_sanitize = true
132    cfi = true
133    cfi_cross_dso = true
134    debug = false
135  }
136  include_dirs = [
137    "dentry/include",
138    "log/include",
139  ]
140  sources = [
141    "dentry/src/file_utils.cpp",
142    "dentry/src/meta_file.cpp",
143  ]
144
145  public_configs = [ ":dentry_public_config" ]
146
147  deps = [ "${utils_path}:libdistributedfileutils" ]
148
149  external_deps = [
150    "c_utils:utils",
151    "hilog:libhilog",
152  ]
153
154  defines = [
155    "LOG_DOMAIN=0xD004307",
156    "LOG_TAG=\"CLOUDSYNC_SA\"",
157  ]
158
159  if (cloudsync_service_hicollie_enable) {
160    external_deps += [ "hicollie:libhicollie" ]
161    defines += [ "HICOLLIE_ENABLE" ]
162  }
163
164  part_name = "dfs_service"
165  subsystem_name = "filemanagement"
166}
167