blob: 99a7372cc5abdc1c890e1f02febef3d112177c00 [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",
Steven Morelandf0336cb2019-06-12 17:18:34 -070047 "libcutils",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070048 "libutils",
49 "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"],
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",
83 "libnetdutils",
84 "libutils",
85 ],
86}
Joel Fernandes48452882018-12-17 13:47:54 -080087
88cc_test {
89 name: "libbpf_load_test",
90 srcs: [
91 "BpfLoadTest.cpp",
92 ],
93 defaults: ["bpf_defaults"],
94 cflags: [
95 "-Wall",
96 "-Werror",
97 "-Wno-error=unused-variable",
98 ],
99 static_libs: ["libgmock"],
100 shared_libs: [
101 "libbpf_android",
102 "libbpf",
103 "libbase",
104 "liblog",
105 "libnetdutils",
106 "libutils",
107 ],
108
109 required: [
110 "bpf_load_tp_prog.o",
111 ],
112}