1# Copyright (c) 2021-2025 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/hiview/hiview.gni") 15import("//build/config/components/idl_tool/idl.gni") 16import("//build/ohos.gni") 17 18idl_gen_interface("hiview_service_idl_interface") { 19 sources = [ "IHiviewServiceAbility.idl" ] 20 21 log_domainid = "0xD002D10" 22 log_tag = "HiviewService" 23 subsystem_name = "hiviewdfx" 24 part_name = "hiview" 25} 26 27config("hiview_service_stub_inner_public_config") { 28 include_dirs = [ 29 "${target_gen_dir}", 30 "$hiview_adapter/service/common/include", 31 ] 32} 33 34ohos_source_set("hiview_service_stub_inner") { 35 branch_protector_ret = "pac_ret" 36 sanitize = { 37 cfi = true 38 cfi_cross_dso = true 39 cfi_vcall_icall_only = true 40 debug = false 41 } 42 43 public_configs = [ ":hiview_service_stub_inner_public_config" ] 44 45 include_dirs = [ 46 "$hiview_base/include", 47 "$hiview_interfaces/inner_api/unified_collection", 48 ] 49 50 output_values = get_target_outputs(":hiview_service_idl_interface") 51 sources = filter_include(output_values, [ "*_stub.cpp" ]) 52 53 deps = [ ":hiview_service_idl_interface" ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "hilog:libhilog", 58 "ipc:ipc_single", 59 ] 60 61 part_name = "hiview" 62 subsystem_name = "hiviewdfx" 63} 64 65config("hiview_service_proxy_public_config") { 66 include_dirs = [ 67 "${target_gen_dir}", 68 "$hiview_adapter/service/common/include", 69 ] 70} 71 72ohos_source_set("hiview_service_proxy") { 73 branch_protector_ret = "pac_ret" 74 sanitize = { 75 cfi = true 76 cfi_cross_dso = true 77 cfi_vcall_icall_only = true 78 debug = false 79 } 80 81 public_configs = [ ":hiview_service_proxy_public_config" ] 82 83 include_dirs = [ 84 "$hiview_base/include", 85 "$hiview_interfaces/inner_api/unified_collection", 86 ] 87 88 output_values = get_target_outputs(":hiview_service_idl_interface") 89 sources = filter_include(output_values, [ "*_proxy.cpp" ]) 90 sources += [ 91 "../common/src/app_caller_parcelable.cpp", 92 "../common/src/hiview_file_info.cpp", 93 "../common/src/memory_caller_parcelable.cpp", 94 ] 95 96 deps = [ ":hiview_service_idl_interface" ] 97 98 external_deps = [ 99 "c_utils:utils", 100 "hilog:libhilog", 101 "ipc:ipc_single", 102 ] 103 104 part_name = "hiview" 105 subsystem_name = "hiviewdfx" 106} 107 108config("hiview_service_ability_config") { 109 visibility = [ "*:*" ] 110 111 include_dirs = [ 112 "include", 113 "$hiview_adapter/service/common/include", 114 "$hiview_base/utility/include", 115 "$hiview_service", 116 ] 117} 118 119ohos_source_set("hiview_service_impl_for_unified_collection") { 120 public_configs = [ ":hiview_service_ability_config" ] 121 122 include_dirs = [ 123 "$hiview_base/include", 124 "$hiview_interfaces/inner_api/unified_collection", 125 ] 126 127 sources = [ 128 "src/hiview_remote_service.cpp", 129 "src/hiview_service_cpu_delegate.cpp", 130 "src/hiview_service_memory_delegate.cpp", 131 "src/hiview_service_trace_delegate.cpp", 132 ] 133 134 deps = [ "$hiview_adapter/service/client:hiview_service_proxy" ] 135 136 external_deps = [ 137 "c_utils:utils", 138 "hilog:libhilog", 139 "ipc:ipc_single", 140 "samgr:samgr_proxy", 141 "storage_service:storage_manager_acl", 142 ] 143 144 part_name = "hiview" 145 146 subsystem_name = "hiviewdfx" 147} 148