blob: 956fd9354e6df04d93379b82dedd5b62270c6ce2 [file] [log] [blame]
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -07001//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_library_headers {
Chenbo Feng79a4da22018-11-08 11:32:31 -080018 name: "libbpf_android_headers",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070019 vendor_available: false,
20 host_supported: false,
21 export_include_dirs: ["include"],
22 target: {
23 linux_bionic: {
24 enabled: true,
25 },
26 },
27}
28
29cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080030 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070031 vendor_available: false,
32 host_supported: false,
33 target: {
34 android: {
35 srcs: [
36 "BpfUtils.cpp",
Joel Fernandesd76a2002018-10-16 13:19:58 -070037 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070038 ],
39 sanitize: {
40 misc_undefined: ["integer"],
41 },
42 },
43 },
44
45 shared_libs: [
46 "libbase",
47 "libutils",
Zhijun He855cf182019-06-19 04:44:24 +000048 "libprocessgroup",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070049 "liblog",
50 "libnetdutils",
Joel Fernandesd76a2002018-10-16 13:19:58 -070051 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070052 ],
53 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080054 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070055 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080056 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080057 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070058 local_include_dirs: ["include"],
59
60 defaults: ["bpf_defaults"],
61 cflags: [
62 "-Werror",
63 "-Wall",
64 "-Wextra",
65 ],
66}
67
68cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080069 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070070 srcs: [
71 "BpfMapTest.cpp",
72 ],
73 defaults: ["bpf_defaults"],
74 cflags: [
75 "-Wall",
76 "-Werror",
77 "-Wno-error=unused-variable",
78 ],
79 static_libs: ["libgmock"],
80 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080081 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070082 "libbase",
83 "liblog",
84 "libnetdutils",
85 "libutils",
86 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070087 require_root: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070088}
Joel Fernandes48452882018-12-17 13:47:54 -080089
90cc_test {
91 name: "libbpf_load_test",
92 srcs: [
93 "BpfLoadTest.cpp",
94 ],
95 defaults: ["bpf_defaults"],
96 cflags: [
97 "-Wall",
98 "-Werror",
99 "-Wno-error=unused-variable",
100 ],
101 static_libs: ["libgmock"],
102 shared_libs: [
103 "libbpf_android",
104 "libbpf",
105 "libbase",
106 "liblog",
107 "libnetdutils",
108 "libutils",
109 ],
110
111 required: [
112 "bpf_load_tp_prog.o",
113 ],
114}