# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. # 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("//build/ohos.gni") import("../../base/config.gni") config("hiprofiler_plugins_config") { include_dirs = [ "./include", "./src", "../../base/include/", "${OHOS_PROFILER_DIR}/device/services/ipc/include", "${OHOS_PROFILER_DIR}/device/services/shared_memory/include", "${OHOS_PROFILER_DIR}/interfaces/kits", ] cflags = [ "-pthread" ] if (current_toolchain != host_toolchain) { cflags += [ "-DHAVE_HILOG" ] } } ohos_source_set("plugins_sources") { part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" include_dirs = [ "./include", "../../base/include/", "${OHOS_PROFILER_DIR}/interfaces/kits", ] sources = [ "src/buffer_writer.cpp", "src/command_poller.cpp", "src/plugin_manager.cpp", "src/plugin_module.cpp", "src/plugin_watcher.cpp", "src/writer_adapter.cpp", ] public_deps = [ "${OHOS_PROFILER_DIR}/device/plugins/ffrt_profiler/service:ffrt_profiler_service", "${OHOS_PROFILER_DIR}/device/plugins/network_profiler/service:network_profiler_service", "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source", "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source", "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto", "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source", "../../base:hiprofiler_base", ] public_configs = [ ":hiprofiler_plugins_config", "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config", ] if (current_toolchain != host_toolchain) { external_deps = [ "bounds_checking_function:libsec_shared", "hilog:libhilog", "openssl:libcrypto_shared", "protobuf:protobuf_lite", ] } defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } ohos_prebuilt_etc("hiprofiler_plugins.cfg") { source = "../../etc/hiprofiler_plugins.cfg" relative_install_dir = "init" part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" } ohos_executable("hiprofiler_plugins") { deps = [ ":hiprofiler_plugins.cfg", ":plugins_sources", ] sources = [ "src/main.cpp" ] if (current_toolchain != host_toolchain) { defines = [ "HAVE_HILOG" ] external_deps = [ "bounds_checking_function:libsec_shared", "hilog:libhilog", "openssl:libcrypto_shared", "protobuf:protobuf_lite", ] } install_enable = true subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" part_name = "${OHOS_PROFILER_PART_NAME}" }