mirror of
https://gitee.com/openharmony/third_party_libbpf
synced 2024-10-07 06:23:25 +00:00
101 lines
2.6 KiB
Plaintext
101 lines
2.6 KiB
Plaintext
|
# Copyright (C) 2021 Huawei Device Co., Ltd.
|
||
|
# 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("//build/ohos/ndk/ndk.gni")
|
||
|
config("libbpf_config") {
|
||
|
cflags = [
|
||
|
"-Wno-incompatible-pointer-types",
|
||
|
"-Wimplicit-function-declaration",
|
||
|
"-Wno-tautological-constant-out-of-range-compare",
|
||
|
"-Wno-constant-conversion",
|
||
|
"-Wno-unknown-attributes",
|
||
|
"-Wno-bitwise-op-parentheses",
|
||
|
"-Wno-shift-op-parentheses",
|
||
|
"-Wno-sign-compare",
|
||
|
"-Wno-unused-function",
|
||
|
"-fno-omit-frame-pointer",
|
||
|
"-mno-omit-leaf-frame-pointer",
|
||
|
"-fno-inline",
|
||
|
"-fno-optimize-sibling-calls",
|
||
|
"-ferror-limit=0",
|
||
|
"-Wno-unused-variable",
|
||
|
"-Wno-uninitialized",
|
||
|
]
|
||
|
defines = [
|
||
|
"HAVE_ELFIO",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
config("libbpf_public_config") {
|
||
|
include_dirs = [
|
||
|
"./src",
|
||
|
"./include",
|
||
|
"./include/uapi",
|
||
|
"//third_party/zlib",
|
||
|
"//third_party/elfio/c_wrapper",
|
||
|
"//third_party/elfio/elfio",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
ohos_shared_library("libbpf") {
|
||
|
deps = [
|
||
|
"//third_party/elfio:elfio",
|
||
|
"//third_party/zlib:libz",
|
||
|
]
|
||
|
sources = [
|
||
|
"./src/bpf.c",
|
||
|
"./src/bpf_core_read.h",
|
||
|
"./src/bpf_endian.h",
|
||
|
"./src/bpf_gen_internal.h",
|
||
|
"./src/bpf.h",
|
||
|
"./src/bpf_helper_defs.h",
|
||
|
"./src/bpf_helpers.h",
|
||
|
"./src/bpf_prog_linfo.c",
|
||
|
"./src/bpf_tracing.h",
|
||
|
"./src/btf.c",
|
||
|
"./src/btf_dump.c",
|
||
|
"./src/btf.h",
|
||
|
"./src/gen_loader.c",
|
||
|
"./src/hashmap.c",
|
||
|
"./src/hashmap.h",
|
||
|
"./src/libbpf.c",
|
||
|
"./src/libbpf_common.h",
|
||
|
"./src/libbpf_errno.c",
|
||
|
"./src/libbpf.h",
|
||
|
"./src/libbpf_internal.h",
|
||
|
"./src/libbpf_legacy.h",
|
||
|
"./src/libbpf_probes.c",
|
||
|
"./src/libbpf_version.h",
|
||
|
"./src/netlink.c",
|
||
|
"./src/nlattr.c",
|
||
|
"./src/nlattr.h",
|
||
|
"./src/relo_core.c",
|
||
|
"./src/relo_core.h",
|
||
|
"./src/ringbuf.c",
|
||
|
"./src/skel_internal.h",
|
||
|
"./src/str_error.c",
|
||
|
"./src/str_error.h",
|
||
|
"./src/strset.c",
|
||
|
"./src/strset.h",
|
||
|
"./src/xsk.c",
|
||
|
"./src/xsk.h",
|
||
|
]
|
||
|
configs = [ ":libbpf_config" ]
|
||
|
public_configs = [ ":libbpf_public_config" ]
|
||
|
subsystem_name = "developtools"
|
||
|
part_name = "profiler"
|
||
|
install_enable = true
|
||
|
}
|
||
|
|