1# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. 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("//build/ohos.gni") 15import("../../base/config.gni") 16 17ohos_shared_library("xpowerplugin") { 18 output_name = "xpowerplugin" 19 version_script = "libxpower_plugin.map" 20 sources = [ 21 "src/power_message_queue.cpp", 22 "src/xpower_module.cpp", 23 "src/xpower_plugin.cpp", 24 ] 25 include_dirs = [ 26 "include", 27 "${OHOS_PROFILER_DIR}/interfaces/kits", 28 "${OHOS_PROFILER_DIR}/device/base/include", 29 ] 30 deps = [ 31 "${OHOS_PROFILER_DIR}/protos/types/plugins/xpower_data:xpower_data_cpp", 32 "../../base:hiprofiler_base", 33 ] 34 if (current_toolchain != host_toolchain) { 35 defines = [ "HAVE_HILOG" ] 36 external_deps = [ 37 "bounds_checking_function:libsec_shared", 38 "hilog:libhilog_base", 39 "hisysevent:libhisysevent", 40 "protobuf:protobuf_lite", 41 ] 42 } 43 public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] 44 install_enable = true 45 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 46 part_name = "${OHOS_PROFILER_PART_NAME}" 47} 48 49ohos_executable("xpowerdecoder") { 50 output_name = "xpowerdecoder" 51 include_dirs = [ "./include" ] 52 sources = [ 53 "test/xpower_decoder.cpp", 54 "test/xpower_main.cpp", 55 ] 56 deps = [ 57 "${OHOS_PROFILER_DIR}/device/services/profiler_service:profiler_service", 58 "${OHOS_PROFILER_DIR}/protos/services:proto_services_cpp", 59 "${OHOS_PROFILER_DIR}/protos/types/plugins/xpower_data:xpower_data_cpp", 60 ] 61 cflags = [ 62 "-Wno-error=inline-asm", 63 "-O3", 64 ] 65 ldflags = [ "-rdynamic" ] 66 if (current_toolchain != host_toolchain) { 67 defines = [ "HAVE_HILOG" ] 68 external_deps = [ 69 "bounds_checking_function:libsec_shared", 70 "cJSON:cjson_static", 71 "hilog:libhilog_base", 72 "openssl:libcrypto_shared", 73 "protobuf:protobuf_lite", 74 ] 75 } 76 install_enable = false 77 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 78 part_name = "${OHOS_PROFILER_PART_NAME}" 79} 80