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/dfs_service/distributedfile.gni")
16
17config("clouddisk_database_config") {
18  visibility = [ ":*" ]
19}
20
21config("clouddisk_database_public_config") {
22  visibility = [ ":*" ]
23  include_dirs = [
24    "include",
25    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include",
26    "${distributedfile_path}/interfaces/inner_api/native/cloud_file_kit_inner",
27    "${services_path}/cloudfiledaemon/include/cloud_disk",
28  ]
29}
30
31config("optimize-size") {
32  cflags = [
33    "-fdata-sections",
34    "-ffunction-sections",
35    "-Oz",
36  ]
37  cflags_cc = [
38    "-fvisibility-inlines-hidden",
39    "-Oz",
40  ]
41}
42
43ohos_shared_library("clouddisk_database") {
44  branch_protector_ret = "pac_ret"
45  configs = [ ":optimize-size" ]
46  sanitize = {
47    integer_overflow = true
48    ubsan = true
49    boundary_sanitize = true
50    cfi = true
51    cfi_cross_dso = true
52    debug = false
53  }
54
55  sources = [
56    "src/clouddisk_notify.cpp",
57    "src/clouddisk_notify_utils.cpp",
58    "src/clouddisk_rdb_transaction.cpp",
59    "src/clouddisk_rdb_utils.cpp",
60    "src/clouddisk_rdbstore.cpp",
61    "src/clouddisk_sync_helper.cpp",
62    "src/file_column.cpp",
63  ]
64
65  configs += [ ":clouddisk_database_config" ]
66  public_configs = [ ":clouddisk_database_public_config" ]
67
68  cflags = [
69    "-Wall",
70    "-Werror",
71    "-Wno-unused-but-set-variable",
72  ]
73
74  defines = [
75    "LOG_DOMAIN=0xD00430B",
76    "LOG_TAG=\"CLOUDDISK_DATABASE\"",
77  ]
78
79  deps = [
80    "${innerkits_native_path}/cloudsync_kit_inner:cloudsync_kit_inner_lite",
81    "${utils_path}:libdistributedfileutils",
82    "${utils_path}:libdistributedfileutils_lite",
83  ]
84
85  external_deps = [
86    "ability_base:zuri",
87    "ability_runtime:dataobs_manager",
88    "c_utils:utils",
89    "ffrt:libffrt",
90    "hilog:libhilog",
91    "init:libbegetutil",
92    "ipc:ipc_single",
93    "libfuse:libfuse",
94    "relational_store:native_rdb",
95  ]
96
97  use_exceptions = true
98  part_name = "dfs_service"
99  subsystem_name = "filemanagement"
100}
101