blob: cd2342e5301ae8f474a73cea19ec75f6476712bf [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",
Joel Fernandesd76a2002018-10-16 13:19:58 -070050 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070051 ],
52 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080053 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070054 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080055 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080056 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070057 local_include_dirs: ["include"],
58
59 defaults: ["bpf_defaults"],
60 cflags: [
61 "-Werror",
62 "-Wall",
63 "-Wextra",
64 ],
65}
66
67cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080068 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070069 srcs: [
70 "BpfMapTest.cpp",
71 ],
72 defaults: ["bpf_defaults"],
73 cflags: [
74 "-Wall",
75 "-Werror",
76 "-Wno-error=unused-variable",
77 ],
78 static_libs: ["libgmock"],
79 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080080 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070081 "libbase",
82 "liblog",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070083 "libutils",
84 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070085 require_root: true,
Steven Morelandb5723782020-01-14 11:39:16 -080086 test_suites: ["general-tests"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070087}
Joel Fernandes48452882018-12-17 13:47:54 -080088
89cc_test {
90 name: "libbpf_load_test",
91 srcs: [
92 "BpfLoadTest.cpp",
93 ],
94 defaults: ["bpf_defaults"],
95 cflags: [
96 "-Wall",
97 "-Werror",
98 "-Wno-error=unused-variable",
99 ],
100 static_libs: ["libgmock"],
101 shared_libs: [
102 "libbpf_android",
103 "libbpf",
104 "libbase",
105 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800106 "libutils",
107 ],
108
109 required: [
110 "bpf_load_tp_prog.o",
111 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800112 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800113}