1# Copyright (c) 2021 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("//build/ohos.gni") 15import("../../base/config.gni") 16 17config("hiprofiler_plugins_config") { 18 include_dirs = [ 19 "./include", 20 "./src", 21 "../../base/include/", 22 "${OHOS_PROFILER_DIR}/device/services/ipc/include", 23 "${OHOS_PROFILER_DIR}/device/services/shared_memory/include", 24 "${OHOS_PROFILER_DIR}/interfaces/kits", 25 ] 26 cflags = [ "-pthread" ] 27 if (current_toolchain != host_toolchain) { 28 cflags += [ "-DHAVE_HILOG" ] 29 } 30} 31 32ohos_source_set("plugins_sources") { 33 part_name = "profiler" 34 include_dirs = [ 35 "./include", 36 "../../base/include/", 37 "${OHOS_PROFILER_DIR}/interfaces/kits", 38 "//utils/native/base/include", 39 "//third_party/boringssl/src/include", 40 ] 41 sources = [ 42 "src/buffer_writer.cpp", 43 "src/command_poller.cpp", 44 "src/plugin_manager.cpp", 45 "src/plugin_module.cpp", 46 "src/plugin_watcher.cpp", 47 "src/writer_adapter.cpp", 48 ] 49 public_deps = [ 50 "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory", 51 "${OHOS_PROFILER_DIR}/protos/services:plugin_services_proto", 52 "${OHOS_PROFILER_DIR}/protos/services:service_types_proto", 53 "../../base:hiprofiler_base", 54 "//third_party/boringssl:crypto", 55 "//utils/native/base:utilsecurec", 56 ] 57 public_configs = [ 58 ":hiprofiler_plugins_config", 59 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config", 60 ] 61 if (current_toolchain != host_toolchain) { 62 if (build_l2) { 63 external_deps = [ "shared_library:libhilog" ] 64 } else { 65 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 66 } 67 } 68} 69 70ohos_executable("hiprofiler_plugins") { 71 deps = [ ":plugins_sources" ] 72 sources = [ "src/main.cpp" ] 73 if (current_toolchain != host_toolchain) { 74 defines = [ "HAVE_HILOG" ] 75 if (build_l2) { 76 external_deps = [ "shared_library:libhilog" ] 77 } else { 78 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 79 } 80 } 81 install_enable = true 82 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 83 part_name = "${OHOS_PROFILER_PART_NAME}" 84} 85