1# Copyright (c) Huawei Technologies Co., Ltd. 2022. 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 17config("ebpf_converter_inner_config") { 18 visibility = [ ":*" ] 19 ldflags = [] 20 cflags = [] 21 22 defines = [ "_GNU_SOURCE" ] 23 defines += [ "is_mingw=${is_mingw}" ] 24 defines += [ "WIN32_LEAN_AND_MEAN" ] 25 defines += [ "NOGDI" ] 26 27 ldflags += [ 28 "-Wl,--whole-archive", 29 "-lpthread", 30 "-Wl,--no-whole-archive", 31 "--coverage", 32 ] 33 34 cflags += [ "-std=c++17" ] 35 cflags += [ 36 "-mllvm", 37 "-limited-coverage-experimental=true", 38 "-fno-use-cxa-atexit", 39 "-Wno-inconsistent-dllimport", 40 ] 41} 42 43ohos_executable("ebpf_converter") { 44 public_configs = [] 45 if (!is_mingw) { 46 defines = [ "_GNU_SOURCE" ] 47 } else { 48 public_configs = [ ":ebpf_converter_inner_config" ] 49 } 50 51 sources = [ "src/ebpf_converter.cpp" ] 52 include_dirs = [ "./include" ] 53 external_deps = [ "bounds_checking_function:libsec_shared" ] 54 install_enable = false 55 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 56 part_name = "${OHOS_PROFILER_PART_NAME}" 57} 58