# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/hiview/hiview.gni") import("//build/ohos.gni") if (hiview_enable_leak_detector) { config("leak_detector_config") { visibility = [ ":*" ] include_dirs = [ ".", "./base", "./native_leak", "$hiview_base/event_raw/include", "$hiview_base/event_publish/include", "$hiview_base/include", "$hiview_base/logstore/include", "$hiview_base/utility/include", "$hiview_root/include", "$hiview_root/interfaces/inner_api/unified_collection", "$hiview_root/interfaces/inner_api/unified_collection/utility", "$hiview_plugin/faultlogger/common", "$hiview_plugin/faultlogger/service", ] } } ohos_source_set("leak_detector") { if (hiview_enable_leak_detector) { part_name = "hiview" subsystem_name = "hiviewdfx" sources = [ "fault_detector_manager.cpp", "fault_detector_util.cpp", "native_leak/native_leak_config.cpp", "native_leak/native_leak_detector.cpp", "native_leak/native_leak_info.cpp", "native_leak/native_leak_state.cpp", "native_leak/native_leak_state_context.cpp", "native_leak/native_leak_util.cpp", ] configs = [ ":leak_detector_config" ] deps = [ "config:config" ] external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hiprofiler:libnative_daemon_client", "hisysevent:libhisysevent", "init:libbegetutil", ] if (has_hiprofiler) { cflags = [ "-DHAS_HIPROFILER" ] } } } group("unittest") { testonly = true deps = [ "test:LeakDetectorUnitTest" ] } group("moduletest") { testonly = true deps = [ "test:LeakDetectorModuleTest" ] }