• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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.
13import("//build/config/components/idl_tool/idl.gni")
14import("//build/ohos.gni")
15import("//build/ohos_var.gni")
16import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni")
17
18idl_gen_interface("storage_manager_interface_native") {
19  sources = [ "${storage_manager_path}/IStorageManager.idl" ]
20  sources_callback = ["IUeceActivationCallback.idl"]
21  log_tag = "StorageManager"
22  log_domainid = "0xD004300"
23  hitrace = "HITRACE_TAG_FILEMANAGEMENT"
24}
25
26config("public_config") {
27  include_dirs = [
28    ".",
29    "${target_gen_dir}",
30  ]
31}
32
33config("private_config") {
34  include_dirs = [
35    "${storage_manager_path}/include",
36    "${storage_service_path}/services/storage_daemon/include",
37    "${storage_service_common_path}/include",
38    "${storage_interface_path}/innerkits/storage_manager/native",
39  ]
40}
41ohos_source_set("storage_manager_ipc_native") {
42  sanitize = {
43    debug = false
44    cfi = true
45    cfi_cross_dso = true
46  }
47  output_values = get_target_outputs(":storage_manager_interface_native")
48  sources = []
49  sources += filter_include(output_values, [ "*.cpp" ])
50  public_configs = [ ":public_config" ]
51  deps = [ ":storage_manager_interface_native" ]
52  external_deps = [
53    "c_utils:utils",
54    "hilog:libhilog",
55    "hitrace:hitrace_meter",
56    "ipc:ipc_core",
57  ]
58  part_name = "storage_service"
59  subsystem_name = "filemanagement"
60}
61
62ohos_source_set("storage_manager_header") {
63  sanitize = {
64    debug = false
65    cfi = true
66    cfi_cross_dso = true
67  }
68  public_configs = [ ":public_config" ]
69  deps = [ ":storage_manager_interface_native" ]
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73    "hitrace:hitrace_meter",
74    "ipc:ipc_core",
75  ]
76  part_name = "storage_service"
77  subsystem_name = "filemanagement"
78}
79
80ohos_shared_library("storage_manager_sa_proxy") {
81  branch_protector_ret = "pac_ret"
82  sanitize = {
83    integer_overflow = true
84    ubsan = true
85    boundary_sanitize = true
86    cfi = true
87    cfi_cross_dso = true
88    debug = false
89  }
90
91  sources = [
92    "${storage_manager_path}/innerkits_impl/src/bundle_stats.cpp",
93    "${storage_manager_path}/innerkits_impl/src/disk.cpp",
94    "${storage_manager_path}/innerkits_impl/src/storage_file_raw_data.cpp",
95    "${storage_manager_path}/innerkits_impl/src/storage_stats.cpp",
96    "${storage_manager_path}/innerkits_impl/src/volume_core.cpp",
97    "${storage_manager_path}/innerkits_impl/src/volume_external.cpp",
98    "${storage_manager_path}/utils/src/storage_utils.cpp",
99  ]
100
101  defines = [
102    "STORAGE_LOG_TAG = \"StorageManager\"",
103    "LOG_DOMAIN = 0xD004300",
104  ]
105
106  configs = [ ":private_config" ]
107  public_configs = [ ":public_config" ]
108
109  cflags = [
110    "-D_FORTIFY_SOURCE=2",
111    "-fstack-protector-strong",
112  ]
113
114  external_deps = [
115    "c_utils:utils",
116    "hilog:libhilog",
117    "hitrace:hitrace_meter",
118    "ipc:ipc_single",
119  ]
120
121  deps = [
122    ":storage_manager_header",
123    ":storage_manager_interface_native",
124    ":storage_manager_ipc_native",
125  ]
126  part_name = "storage_service"
127  innerapi_tags = [ "platformsdk" ]
128  subsystem_name = "filemanagement"
129
130  if (storage_service_media_fuse) {
131    defines += [ "STORAGE_SERVICE_MEDIA_FUSE" ]
132  }
133}
134