blob: 06528c8c1c35f908138bb8ba35643f88ade4359a [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
Bob Badourdcbf8ca2021-02-03 22:55:55 -080017package {
18 // http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // the below license kinds from "system_bpf_license":
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["system_bpf_license"],
23}
24
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070025cc_library_headers {
Chenbo Feng79a4da22018-11-08 11:32:31 -080026 name: "libbpf_android_headers",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070027 vendor_available: false,
28 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070029 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070030 export_include_dirs: ["include"],
31 target: {
32 linux_bionic: {
33 enabled: true,
34 },
35 },
Lorenzo Colitti8cc4f912021-01-08 12:55:34 +090036 sdk_version: "30",
Hungming Chena46f2172021-01-13 13:56:38 +080037 header_libs: ["bpf_syscall_wrappers"],
38 export_header_lib_headers: ["bpf_syscall_wrappers"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070039}
40
41cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080042 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070043 vendor_available: false,
44 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070045 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070046 target: {
47 android: {
48 srcs: [
49 "BpfUtils.cpp",
Joel Fernandesd76a2002018-10-16 13:19:58 -070050 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070051 ],
52 sanitize: {
53 misc_undefined: ["integer"],
54 },
55 },
56 },
57
58 shared_libs: [
59 "libbase",
60 "libutils",
Zhijun He855cf182019-06-19 04:44:24 +000061 "libprocessgroup",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070062 "liblog",
Joel Fernandesd76a2002018-10-16 13:19:58 -070063 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070064 ],
65 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080066 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070067 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080068 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080069 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070070 local_include_dirs: ["include"],
71
72 defaults: ["bpf_defaults"],
73 cflags: [
74 "-Werror",
75 "-Wall",
76 "-Wextra",
77 ],
78}
79
80cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080081 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070082 srcs: [
83 "BpfMapTest.cpp",
84 ],
85 defaults: ["bpf_defaults"],
86 cflags: [
87 "-Wall",
88 "-Werror",
89 "-Wno-error=unused-variable",
90 ],
91 static_libs: ["libgmock"],
92 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080093 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070094 "libbase",
95 "liblog",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070096 "libutils",
97 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070098 require_root: true,
Steven Morelandb5723782020-01-14 11:39:16 -080099 test_suites: ["general-tests"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -0700100}
Joel Fernandes48452882018-12-17 13:47:54 -0800101
102cc_test {
103 name: "libbpf_load_test",
104 srcs: [
105 "BpfLoadTest.cpp",
106 ],
107 defaults: ["bpf_defaults"],
108 cflags: [
109 "-Wall",
110 "-Werror",
111 "-Wno-error=unused-variable",
112 ],
113 static_libs: ["libgmock"],
114 shared_libs: [
115 "libbpf_android",
116 "libbpf",
117 "libbase",
118 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800119 "libutils",
120 ],
121
122 required: [
123 "bpf_load_tp_prog.o",
124 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800125 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800126}