blob: 507ca188c181a6e75919ad18379d750aba20d118 [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,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070021 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070022 export_include_dirs: ["include"],
23 target: {
24 linux_bionic: {
25 enabled: true,
26 },
27 },
28}
29
30cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080031 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070032 vendor_available: false,
33 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070034 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070035 target: {
36 android: {
37 srcs: [
38 "BpfUtils.cpp",
Joel Fernandesd76a2002018-10-16 13:19:58 -070039 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070040 ],
41 sanitize: {
42 misc_undefined: ["integer"],
43 },
44 },
45 },
46
47 shared_libs: [
48 "libbase",
49 "libutils",
Zhijun He855cf182019-06-19 04:44:24 +000050 "libprocessgroup",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070051 "liblog",
Joel Fernandesd76a2002018-10-16 13:19:58 -070052 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070053 ],
54 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080055 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070056 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080057 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080058 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070059 local_include_dirs: ["include"],
60
61 defaults: ["bpf_defaults"],
62 cflags: [
63 "-Werror",
64 "-Wall",
65 "-Wextra",
66 ],
67}
68
69cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080070 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070071 srcs: [
72 "BpfMapTest.cpp",
73 ],
74 defaults: ["bpf_defaults"],
75 cflags: [
76 "-Wall",
77 "-Werror",
78 "-Wno-error=unused-variable",
79 ],
80 static_libs: ["libgmock"],
81 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080082 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070083 "libbase",
84 "liblog",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070085 "libutils",
86 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070087 require_root: true,
Steven Morelandb5723782020-01-14 11:39:16 -080088 test_suites: ["general-tests"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070089}
Joel Fernandes48452882018-12-17 13:47:54 -080090
91cc_test {
92 name: "libbpf_load_test",
93 srcs: [
94 "BpfLoadTest.cpp",
95 ],
96 defaults: ["bpf_defaults"],
97 cflags: [
98 "-Wall",
99 "-Werror",
100 "-Wno-error=unused-variable",
101 ],
102 static_libs: ["libgmock"],
103 shared_libs: [
104 "libbpf_android",
105 "libbpf",
106 "libbase",
107 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800108 "libutils",
109 ],
110
111 required: [
112 "bpf_load_tp_prog.o",
113 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800114 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800115}