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 17config("security_guard_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "${sg_root_dir}/interfaces/inner_api/collect/include", 21 "${sg_root_dir}/interfaces/inner_api/common/include", 22 "${sg_root_dir}/interfaces/inner_api/collector/include", 23 ] 24} 25 26ohos_shared_library("libsg_collect_sdk") { 27 innerapi_tags = [ 28 "platformsdk", 29 "sasdk", 30 ] 31 subsystem_name = "security" 32 part_name = "security_guard" 33 output_name = "libsg_collect_sdk" 34 version_script = "sg_collect_sdk.map" 35 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 36 37 public_configs = [ ":security_guard_config" ] 38 39 include_dirs = [ 40 "include", 41 "${sg_root_dir}/frameworks/common/constants/include", 42 "${sg_root_dir}/interfaces/inner_api/collect/include", 43 "${sg_root_dir}/frameworks/common/collect/include", 44 "${sg_root_dir}/interfaces/inner_api/collector/include", 45 "${sg_root_dir}/frameworks/common/collector/include", 46 "${sg_root_dir}/interfaces/inner_api/common/include", 47 "${sg_root_dir}/frameworks/common/log/include", 48 "${sg_root_dir}/frameworks/common/utils/include", 49 ] 50 51 sources = [ 52 "${sg_root_dir}/frameworks/common/collector/src/i_collector_subscriber.cpp", 53 "${sg_root_dir}/frameworks/common/collector/src/security_collector_manager_callback_service.cpp", 54 "${sg_root_dir}/frameworks/common/collector/src/security_collector_manager_callback_stub.cpp", 55 "${sg_root_dir}/frameworks/common/collector/src/security_collector_subscribe_info.cpp", 56 "${sg_root_dir}/frameworks/common/collector/src/security_event.cpp", 57 "${sg_root_dir}/frameworks/common/collector/src/security_event_ruler.cpp", 58 "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp", 59 "src/acquire_data_manager_callback_service.cpp", 60 "src/acquire_data_manager_callback_stub.cpp", 61 "src/data_collect_manager.cpp", 62 "src/data_collect_manager_callback_service.cpp", 63 "src/data_collect_manager_callback_stub.cpp", 64 "src/event_info.cpp", 65 "src/security_event_filter.cpp", 66 "src/security_event_query_callback_service.cpp", 67 "src/security_event_query_callback_stub.cpp", 68 "src/sg_collect_client.cpp", 69 "src/sg_obtaindata_client.cpp", 70 "src/event_subscribe_client.cpp", 71 ] 72 73 deps = [ "${sg_root_dir}/services/data_collect/idl:data_collect_manager_idl_sa_proxy" ] 74 75 sanitize = { 76 integer_overflow = true 77 ubsan = true 78 boundary_sanitize = true 79 cfi = true 80 cfi_cross_dso = true 81 debug = false 82 } 83 branch_protector_ret = "pac_ret" 84 85 external_deps = [ 86 "c_utils:utils", 87 "hilog:libhilog", 88 "ipc:ipc_core", 89 "samgr:samgr_proxy", 90 ] 91} 92