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 public_configs = [ ":hiview_core_config" ] 47 48 sources = [ 49 "bundle_config/plugin_bundle_config.cpp", 50 "hiview_platform.cpp", 51 "plugin_bundle.cpp", 52 "plugin_config.cpp", 53 ] 54 55 deps = [ 56 ":plugin_bundle.json", 57 "$hiview_base:hiviewbase", 58 "platform_config:hiviewplatform_config", 59 ] 60 61 if (hiview_param_update_enable) { 62 deps += [ "param_update:hiview_param_update" ] 63 } 64 65 external_deps = [ 66 "ability_base:base", 67 "ability_base:want", 68 "cJSON:cjson", 69 "faultloggerd:libbacktrace_local", 70 "ffrt:libffrt", 71 "hicollie:libhicollie", 72 "hilog:libhilog", 73 "hisysevent:libhisysevent", 74 "init:libbeget_proxy", 75 "init:libbegetutil", 76 "ipc:ipc_single", 77 "jsoncpp:jsoncpp", 78 ] 79} 80 81ohos_source_set("hiview_core_for_test") { 82 part_name = "hiview" 83 public_configs = [ ":hiview_core_config" ] 84 85 sources = [ 86 "bundle_config/plugin_bundle_config.cpp", 87 "hiview_platform.cpp", 88 "plugin_bundle.cpp", 89 "plugin_config.cpp", 90 ] 91 92 deps = [ 93 "$hiview_base:hiviewbase", 94 "param_update:hiview_param_update_for_tdd", 95 "platform_config:hiviewplatform_config_for_tdd", 96 ] 97 98 external_deps = [ 99 "ability_base:base", 100 "ability_base:want", 101 "cJSON:cjson", 102 "faultloggerd:libbacktrace_local", 103 "ffrt:libffrt", 104 "hicollie:libhicollie", 105 "hilog:libhilog", 106 "hisysevent:libhisysevent", 107 "init:libbeget_proxy", 108 "init:libbegetutil", 109 "ipc:ipc_single", 110 "jsoncpp:jsoncpp", 111 ] 112} 113 114group("unittest") { 115 testonly = true 116 deps = [] 117} 118 119group("moduletest") { 120 testonly = true 121 deps = [] 122} 123