blob: cf443da6b514b68886675b44c2390fbf42cdeb46 [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 },
Lorenzo Colitti8cc4f912021-01-08 12:55:34 +090028 sdk_version: "30",
Hungming Chena46f2172021-01-13 13:56:38 +080029 header_libs: ["bpf_syscall_wrappers"],
30 export_header_lib_headers: ["bpf_syscall_wrappers"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070031}
32
33cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080034 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070035 vendor_available: false,
36 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070037 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070038 target: {
39 android: {
40 srcs: [
41 "BpfUtils.cpp",
Joel Fernandesd76a2002018-10-16 13:19:58 -070042 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070043 ],
44 sanitize: {
45 misc_undefined: ["integer"],
46 },
47 },
48 },
49
50 shared_libs: [
51 "libbase",
52 "libutils",
Zhijun He855cf182019-06-19 04:44:24 +000053 "libprocessgroup",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070054 "liblog",
Joel Fernandesd76a2002018-10-16 13:19:58 -070055 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070056 ],
57 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080058 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070059 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080060 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080061 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070062 local_include_dirs: ["include"],
63
64 defaults: ["bpf_defaults"],
65 cflags: [
66 "-Werror",
67 "-Wall",
68 "-Wextra",
69 ],
70}
71
72cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080073 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070074 srcs: [
75 "BpfMapTest.cpp",
76 ],
77 defaults: ["bpf_defaults"],
78 cflags: [
79 "-Wall",
80 "-Werror",
81 "-Wno-error=unused-variable",
82 ],
83 static_libs: ["libgmock"],
84 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080085 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070086 "libbase",
87 "liblog",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070088 "libutils",
89 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070090 require_root: true,
Steven Morelandb5723782020-01-14 11:39:16 -080091 test_suites: ["general-tests"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070092}
Joel Fernandes48452882018-12-17 13:47:54 -080093
94cc_test {
95 name: "libbpf_load_test",
96 srcs: [
97 "BpfLoadTest.cpp",
98 ],
99 defaults: ["bpf_defaults"],
100 cflags: [
101 "-Wall",
102 "-Werror",
103 "-Wno-error=unused-variable",
104 ],
105 static_libs: ["libgmock"],
106 shared_libs: [
107 "libbpf_android",
108 "libbpf",
109 "libbase",
110 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800111 "libutils",
112 ],
113
114 required: [
115 "bpf_load_tp_prog.o",
116 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800117 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800118}