• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/ohos.gni")
14import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni")
15
16## build sm execute bin file
17config("fscrypt_utils_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "../include/libfscrypt",
22    "${storage_service_common_path}/include",
23  ]
24
25  cflags = [
26    "-g3",
27    "-Wall",
28    "-O2",
29  ]
30}
31
32config("fscrypt_utils_public_config") {
33  visibility = [ ":*" ]
34
35  include_dirs = [ "../include/libfscrypt" ]
36
37  cflags = [
38    "-g3",
39    "-Wall",
40    "-O2",
41  ]
42}
43
44ohos_static_library("libfscryptutils") {
45  branch_protector_ret = "pac_ret"
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  output_name = "libfscryptutils"
56  sources = [
57    "src/fscrypt_control.c",
58    "src/fscrypt_utils.c",
59    "src/init_utils.c",
60    "src/key_control.c",
61    "src/sysparam_dynamic.c",
62  ]
63
64  if (storage_service_user_crypto_manager) {
65    defines = [ "USER_CRYPTO_MANAGER" ]
66  }
67
68  configs = [ ":fscrypt_utils_config" ]
69
70  defines += [
71    "STORAGE_LOG_TAG = \"StorageDaemon\"",
72    "LOG_DOMAIN = 0xD004301",
73  ]
74
75  external_deps = [
76    "c_utils:utils",
77    "hilog:libhilog",
78    "init:libbegetutil",
79  ]
80
81  subsystem_name = "filemanagement"
82  part_name = "storage_service"
83}
84
85ohos_static_library("libfscryptutils_static") {
86  branch_protector_ret = "pac_ret"
87  sanitize = {
88    integer_overflow = true
89    ubsan = true
90    boundary_sanitize = true
91    cfi = true
92    cfi_cross_dso = true
93    debug = false
94  }
95
96  output_name = "libfscryptutils_static"
97  sources = [
98    "src/fscrypt_control.c",
99    "src/fscrypt_utils.c",
100    "src/key_control.c",
101    "src/sysparam_static.c",
102  ]
103
104  if (storage_service_user_crypto_manager) {
105    defines = [ "USER_CRYPTO_MANAGER" ]
106  }
107
108  configs = [ ":fscrypt_utils_config" ]
109  public_configs = [ ":fscrypt_utils_public_config" ]
110
111  defines += [
112    "STORAGE_LOG_TAG = \"StorageDaemon\"",
113    "LOG_DOMAIN = 0xD004301",
114  ]
115
116  external_deps = [
117    "bounds_checking_function:libsec_static",
118    "c_utils:utils",
119    "hilog:libhilog",
120    "init:libbegetutil",
121  ]
122
123  subsystem_name = "filemanagement"
124  part_name = "storage_service"
125}
126