1# Copyright (c) 2021-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/hiviewdfx/hicollie/hicollie.gni") 15import("//build/ohos.gni") 16config("hicollie_include") { 17 include_dirs = [ 18 ".", 19 "${hicollie_part_path}/interfaces/native/innerkits/include/xcollie", 20 ] 21 if (is_ohos) { 22 cflags_cc = [ "-D__XCOLLIE_OHOS__" ] 23 } 24} 25 26ohos_source_set("libhicollie_source") { 27 branch_protector_ret = "pac_ret" 28 sources = [ 29 "handler_checker.cpp", 30 "watchdog.cpp", 31 "watchdog_inner.cpp", 32 "watchdog_task.cpp", 33 "xcollie.cpp", 34 "xcollie_utils.cpp", 35 ] 36 configs = [ ":hicollie_include" ] 37 38 external_deps = [ 39 "c_utils:utils", 40 "faultloggerd:libbacktrace_local", 41 "ffrt:libffrt", 42 "hilog:libhilog", 43 "hiview:libucollection_client", 44 "init:libbegetutil", 45 "ipc:ipc_core", 46 "storage_service:storage_manager_acl", 47 ] 48 49 defines = [] 50 if (!is_asan) { 51 defines += [ "HOOK_ENABLE" ] 52 } 53 54 if (hicollie_jank_detection_enable) { 55 defines += [ "HICOLLIE_JANK_ENABLE" ] 56 } 57 58 if (defined(global_parts_info) && 59 defined(global_parts_info.notification_eventhandler)) { 60 external_deps += [ "eventhandler:libeventhandler" ] 61 } 62 63 if (defined(global_parts_info.hiviewdfx_hisysevent)) { 64 external_deps += [ "hisysevent:libhisysevent" ] 65 defines += [ "HISYSEVENT_ENABLE" ] 66 } 67 part_name = "hicollie" 68 subsystem_name = "hiviewdfx" 69} 70 71group("libhicollie") { 72 deps = [ ":libhicollie_source" ] 73} 74