1# Copyright (c) 2021-2024 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("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/ohos.gni") 15 16config("sysevent_source_config") { 17 include_dirs = [ 18 "$hiview_core/param_update/include", 19 "control/config/include", 20 "control/db/include", 21 "control/include", 22 "include", 23 ] 24 cflags_cc = [ "-D__HIVIEW_OHOS__" ] 25} 26 27ohos_prebuilt_etc("hiview.para.dac") { 28 source = "config/hiview.para.dac" 29 relative_install_dir = "param" 30 part_name = "hiview" 31 subsystem_name = "hiviewdfx" 32} 33 34ohos_prebuilt_etc("monitor_config") { 35 source = "config/monitor.cfg" 36 relative_install_dir = "hiview" 37 part_name = "hiview" 38 subsystem_name = "hiviewdfx" 39} 40 41ohos_source_set("sysevent_source") { 42 branch_protector_ret = "pac_ret" 43 sanitize = { 44 cfi = true 45 cfi_cross_dso = true 46 cfi_vcall_icall_only = true 47 debug = false 48 } 49 configs = [ ":sysevent_source_config" ] 50 51 sources = [ 52 "control/config/daily_config.cpp", 53 "control/daily_controller.cpp", 54 "control/db/daily_db_helper.cpp", 55 "event_json_parser.cpp", 56 "event_server.cpp", 57 "monitor_config.cpp", 58 "platform_monitor.cpp", 59 "sys_event_stat.cpp", 60 "sysevent_source.cpp", 61 ] 62 63 deps = [ 64 ":hiview.para.dac", 65 ":monitor_config", 66 "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter", 67 "$hiview_base:hiviewbase", 68 "$hiview_core:hiview_core", 69 ] 70 71 external_deps = [ 72 "bounds_checking_function:libsec_shared", 73 "cJSON:cjson", 74 "ffrt:libffrt", 75 "hilog:libhilog", 76 "hisysevent:libhisysevent", 77 "init:libbegetutil", 78 "relational_store:native_rdb", 79 "zlib:shared_libz", 80 ] 81 82 part_name = "hiview" 83 subsystem_name = "hiviewdfx" 84} 85 86group("unittest") { 87 testonly = true 88 deps = [ 89 "test/unittest/common:DailyControllerTest", 90 "test/unittest/common:EventJsonParserTest", 91 "test/unittest/common:EventServerTest", 92 "test/unittest/common:SysEventStatTest", 93 ] 94} 95 96group("moduletest") { 97 testonly = true 98 deps = [] 99} 100 101group("fuzztest") { 102 testonly = true 103 deps = [ 104 "test/fuzztest/common/eventserver_fuzzer:EventServerFuzzTest", 105 "test/fuzztest/common/eventserversocket_fuzzer:EventServerSocketFuzzTest", 106 "test/fuzztest/common/eventsource_fuzzer:EventSourceFuzzTest", 107 ] 108} 109