blob: 93dc7c10aad5068b77d011a10e67df68aed13f47 [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",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070029}
30
31cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080032 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070033 vendor_available: false,
34 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070035 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070036 target: {
37 android: {
38 srcs: [
39 "BpfUtils.cpp",
Joel Fernandesd76a2002018-10-16 13:19:58 -070040 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070041 ],
42 sanitize: {
43 misc_undefined: ["integer"],
44 },
45 },
46 },
47
48 shared_libs: [
49 "libbase",
50 "libutils",
Zhijun He855cf182019-06-19 04:44:24 +000051 "libprocessgroup",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070052 "liblog",
Joel Fernandesd76a2002018-10-16 13:19:58 -070053 "libbpf",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070054 ],
55 header_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080056 "libbpf_android_headers"
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070057 ],
Chenbo Feng79a4da22018-11-08 11:32:31 -080058 export_header_lib_headers: ["libbpf_android_headers"],
Steven Moreland4891e612020-01-10 15:35:52 -080059 export_shared_lib_headers: ["libbpf"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070060 local_include_dirs: ["include"],
61
62 defaults: ["bpf_defaults"],
63 cflags: [
64 "-Werror",
65 "-Wall",
66 "-Wextra",
67 ],
68}
69
70cc_test {
Chenbo Feng79a4da22018-11-08 11:32:31 -080071 name: "libbpf_android_test",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070072 srcs: [
73 "BpfMapTest.cpp",
74 ],
75 defaults: ["bpf_defaults"],
76 cflags: [
77 "-Wall",
78 "-Werror",
79 "-Wno-error=unused-variable",
80 ],
81 static_libs: ["libgmock"],
82 shared_libs: [
Chenbo Feng79a4da22018-11-08 11:32:31 -080083 "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070084 "libbase",
85 "liblog",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070086 "libutils",
87 ],
Maciej Żenczykowski1a4659c2019-09-19 14:36:19 -070088 require_root: true,
Steven Morelandb5723782020-01-14 11:39:16 -080089 test_suites: ["general-tests"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070090}
Joel Fernandes48452882018-12-17 13:47:54 -080091
92cc_test {
93 name: "libbpf_load_test",
94 srcs: [
95 "BpfLoadTest.cpp",
96 ],
97 defaults: ["bpf_defaults"],
98 cflags: [
99 "-Wall",
100 "-Werror",
101 "-Wno-error=unused-variable",
102 ],
103 static_libs: ["libgmock"],
104 shared_libs: [
105 "libbpf_android",
106 "libbpf",
107 "libbase",
108 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800109 "libutils",
110 ],
111
112 required: [
113 "bpf_load_tp_prog.o",
114 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800115 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800116}