• 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.
13
14import("//base/security/security_guard/security_guard.gni")
15import("//build/ohos.gni")
16
17ohos_shared_library("sg_config_data_manager") {
18  subsystem_name = "security"
19  part_name = "security_guard"
20
21  defines = []
22
23  configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ]
24
25  include_dirs = [
26    "${sg_root_dir}/services/config_manager/include",
27    "${sg_root_dir}/frameworks/common/constants/include",
28    "${sg_root_dir}/frameworks/common/log/include",
29    "${sg_root_dir}/interfaces/inner_api/common/include",
30    "${sg_root_dir}/interfaces/inner_api/classify/include",
31  ]
32
33  sources =
34      [ "${sg_root_dir}/services/config_manager/src/config_data_manager.cpp" ]
35
36  sanitize = {
37    integer_overflow = true
38    ubsan = true
39    boundary_sanitize = true
40    cfi = true
41    cfi_cross_dso = true
42    debug = false
43  }
44  branch_protector_ret = "pac_ret"
45
46  external_deps = [
47    "hilog:libhilog",
48    "ffrt:libffrt",
49  ]
50}
51
52ohos_shared_library("sg_config_manager") {
53  subsystem_name = "security"
54  part_name = "security_guard"
55  version_script = "sg_config_manager.map"
56
57  defines = []
58  defines += [
59    "SECURITY_GUARD_EVENT_CFG_SOURCE = \"${security_guard_event_cfg_source}\"",
60    "SECURITY_GUARD_MODEL_CFG_SOURCE = \"${security_guard_model_cfg_source}\"",
61    "SECURITY_GUARD_EVENT_GROUP_CFG_SOURCE = \"${security_guard_event_group_cfg_source}\"",
62    "SECURITY_GUARD_CONFIG_UPDATE_TRUST_LIST_SOURCE = \"${security_guard_config_update_trust_list_source}\"",
63    "SECURITY_GUARD_COLLECTOR_CFG_SOURCE = \"${security_guard_collector_cfg_source}\"",
64  ]
65
66  configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ]
67
68  include_dirs = [
69    "${sg_root_dir}/services/config_manager/include",
70    "${sg_root_dir}/frameworks/common/constants/include",
71    "${sg_root_dir}/frameworks/common/json/include",
72    "${sg_root_dir}/frameworks/common/log/include",
73    "${sg_root_dir}/frameworks/common/utils/include",
74    "${sg_root_dir}/services/bigdata/include",
75    "${sg_root_dir}/services/data_collect/store/include",
76    "${sg_root_dir}/interfaces/inner_api/common/include",
77    "${sg_root_dir}/interfaces/inner_api/classify/include",
78    "${sg_root_dir}/frameworks/common/classify/include",
79  ]
80
81  sources = [
82    "${sg_root_dir}/frameworks/common/json/src/json_cfg.cpp",
83    "${sg_root_dir}/frameworks/common/utils/src/file_util.cpp",
84    "${sg_root_dir}/frameworks/common/utils/src/json_util.cpp",
85    "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp",
86    "${sg_root_dir}/services/config_manager/src/base_config.cpp",
87    "${sg_root_dir}/services/config_manager/src/config_manager.cpp",
88    "${sg_root_dir}/services/config_manager/src/config_operator.cpp",
89    "${sg_root_dir}/services/config_manager/src/config_subscriber.cpp",
90    "${sg_root_dir}/services/config_manager/src/event_config.cpp",
91    "${sg_root_dir}/services/config_manager/src/event_group_config.cpp",
92    "${sg_root_dir}/services/config_manager/src/interface.cpp",
93    "${sg_root_dir}/services/config_manager/src/model_cfg_marshalling.cpp",
94    "${sg_root_dir}/services/config_manager/src/model_config.cpp",
95  ]
96
97  sanitize = {
98    integer_overflow = true
99    ubsan = true
100    boundary_sanitize = true
101    cfi = true
102    cfi_cross_dso = true
103    debug = false
104  }
105  branch_protector_ret = "pac_ret"
106
107  deps = [
108    "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk",
109    "${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
110    "${sg_root_dir}/services/config_manager:sg_config_data_manager",
111  ]
112
113  external_deps = [
114    "cJSON:cjson",
115    "c_utils:utils",
116    "hilog:libhilog",
117    "ipc:ipc_core",
118    "json:nlohmann_json_static",
119    "ffrt:libffrt",
120  ]
121}
122