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. 13import("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/ohos.gni") 15 16ohos_prebuilt_etc("plugin_bundle.json") { 17 source = "bundle_config/config/plugin_bundle.json" 18 relative_install_dir = "hiview/bundle" 19 part_name = "hiview" 20 subsystem_name = "hiviewdfx" 21} 22 23config("hiview_core_config") { 24 visibility = [ "*:*" ] 25 include_dirs = [ 26 "bundle_config/include", 27 "include", 28 "$hiview_root/include", 29 ] 30 cflags_cc = [ "-D__HIVIEW_OHOS__" ] 31 32 if (hiview_param_update_enable) { 33 defines = [ "PARAM_UPDATE_ENABLE" ] 34 } 35} 36 37ohos_source_set("hiview_core") { 38 branch_protector_ret = "pac_ret" 39 sanitize = { 40 cfi = true 41 cfi_cross_dso = true 42 cfi_vcall_icall_only = true 43 debug = false 44 } 45 part_name = "hiview" 46 subsystem_name = "hiviewdfx" 47 public_configs = [ ":hiview_core_config" ] 48 49 sources = [ 50 "bundle_config/plugin_bundle_config.cpp", 51 "hiview_platform.cpp", 52 "plugin_bundle.cpp", 53 "plugin_config.cpp", 54 ] 55 56 deps = [ 57 ":plugin_bundle.json", 58 "$hiview_base:hiviewbase", 59 "platform_config:hiviewplatform_config", 60 ] 61 62 if (hiview_param_update_enable) { 63 deps += [ "param_update:hiview_param_update" ] 64 } 65 66 external_deps = [ 67 "ability_base:base", 68 "ability_base:want", 69 "cJSON:cjson", 70 "common_event_service:cesfwk_innerkits", 71 "c_utils:utils", 72 "ffrt:libffrt", 73 "hilog:libhilog", 74 "hisysevent:libhisysevent", 75 "init:libbeget_proxy", 76 "init:libbegetutil", 77 "ipc:ipc_single", 78 "jsoncpp:jsoncpp", 79 ] 80} 81 82ohos_source_set("hiview_core_for_test") { 83 part_name = "hiview" 84 subsystem_name = "hiviewdfx" 85 public_configs = [ ":hiview_core_config" ] 86 87 sources = [ 88 "bundle_config/plugin_bundle_config.cpp", 89 "hiview_platform.cpp", 90 "plugin_bundle.cpp", 91 "plugin_config.cpp", 92 ] 93 94 deps = [ 95 "$hiview_base:hiviewbase", 96 "param_update:hiview_param_update_for_tdd", 97 "platform_config:hiviewplatform_config_for_tdd", 98 ] 99 100 external_deps = [ 101 "ability_base:base", 102 "ability_base:want", 103 "cJSON:cjson", 104 "common_event_service:cesfwk_innerkits", 105 "c_utils:utils", 106 "ffrt:libffrt", 107 "hilog:libhilog", 108 "hisysevent:libhisysevent", 109 "init:libbeget_proxy", 110 "init:libbegetutil", 111 "ipc:ipc_single", 112 "jsoncpp:jsoncpp", 113 ] 114} 115 116group("unittest") { 117 testonly = true 118 deps = [] 119} 120 121group("moduletest") { 122 testonly = true 123 deps = [] 124} 125