1# Copyright (c) 2023 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("security_collector_service") {
18  subsystem_name = "security"
19  part_name = "security_guard"
20
21  include_dirs = [
22    "${sg_root_dir}/frameworks/common/interfaces",
23    "${sg_root_dir}/interfaces/inner_api/collector/include",
24    "${sg_root_dir}/services/security_collector/include",
25    "${sg_root_dir}/frameworks/common/log/include",
26    "${sg_root_dir}/frameworks/common/constants/include",
27    "${sg_root_dir}/frameworks/common/task_handler/include",
28    "${sg_root_dir}/frameworks/common/json/include",
29    "${sg_root_dir}/frameworks/common/utils/include",
30  ]
31
32  sources = [
33    "${sg_root_dir}/frameworks/common/json/src/json_cfg.cpp",
34    "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp",
35    "${sg_root_dir}/interfaces/inner_api/collector/src/security_collector_subscribe_info.cpp",
36    "${sg_root_dir}/services/security_collector/src/collector_cfg_marshalling.cpp",
37    "${sg_root_dir}/services/security_collector/src/data_collection.cpp",
38    "${sg_root_dir}/services/security_collector/src/lib_loader.cpp",
39    "${sg_root_dir}/services/security_collector/src/security_collector_manager_callback_proxy.cpp",
40    "${sg_root_dir}/services/security_collector/src/security_collector_manager_service.cpp",
41    "${sg_root_dir}/services/security_collector/src/security_collector_manager_stub.cpp",
42    "${sg_root_dir}/services/security_collector/src/security_collector_run_manager.cpp",
43    "${sg_root_dir}/services/security_collector/src/security_collector_subscriber_manager.cpp",
44  ]
45
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  stack_protector_ret = true
55
56  deps = [
57    "${sg_root_dir}/frameworks/common/task_handler:sg_task_stamp",
58    "${sg_root_dir}/interfaces/inner_api/collect:libsg_collect_sdk",
59    "${sg_root_dir}/interfaces/inner_api/collector:libsg_collector_sdk",
60  ]
61
62  external_deps = [
63    "access_token:libaccesstoken_sdk",
64    "access_token:libtokenid_sdk",
65    "c_utils:utils",
66    "hilog:libhilog",
67    "hisysevent:libhisysevent",
68    "hisysevent:libhisyseventmanager",
69    "ipc:ipc_core",
70    "json:nlohmann_json_static",
71    "os_account:os_account_innerkits",
72    "preferences:native_preferences",
73    "relational_store:native_rdb",
74    "safwk:system_ability_fwk",
75    "samgr:samgr_proxy",
76  ]
77}
78