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 "ipc_full.cpp", 31 "watchdog.cpp", 32 "watchdog_inner.cpp", 33 "watchdog_task.cpp", 34 "xcollie.cpp", 35 "xcollie_utils.cpp", 36 ] 37 configs = [ ":hicollie_include" ] 38 39 external_deps = [ 40 "c_utils:utils", 41 "faultloggerd:libbacktrace_local", 42 "ffrt:libffrt", 43 "hilog:libhilog", 44 "hiview:libucollection_client", 45 "init:libbegetutil", 46 "ipc:ipc_core", 47 "storage_service:storage_manager_acl", 48 ] 49 50 defines = [] 51 if (use_musl && !is_asan) { 52 defines += [ "HOOK_ENABLE" ] 53 } 54 55 if (hicollie_suspend_check_enable) { 56 defines += [ "SUSPEND_CHECK_ENABLE" ] 57 } 58 59 if (hicollie_jank_detection_enable) { 60 defines += [ "HICOLLIE_JANK_ENABLE" ] 61 } 62 63 if (defined(global_parts_info) && 64 defined(global_parts_info.notification_eventhandler)) { 65 external_deps += [ "eventhandler:libeventhandler" ] 66 } 67 68 if (defined(global_parts_info.hiviewdfx_hisysevent)) { 69 external_deps += [ "hisysevent:libhisysevent" ] 70 defines += [ "HISYSEVENT_ENABLE" ] 71 } 72 part_name = "hicollie" 73 subsystem_name = "hiviewdfx" 74} 75 76group("libhicollie") { 77 deps = [ ":libhicollie_source" ] 78} 79