blob: c52c336ce2dd7371c01765457829ae3ee8c56437 [file] [log] [blame]
Chenbo Fengc10a8a42017-12-15 13:56:33 -08001//
2// Copyright (C) 2017 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 {
18 name: "libbpf_headers",
19 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 {
30 name: "libbpf",
31 vendor_available: false,
32 host_supported: false,
33 target: {
34 android: {
35 srcs: [
36 "BpfUtils.cpp",
Chenbo Fengf43bf812017-12-15 18:27:22 -080037 "BpfNetworkStats.cpp"
Chenbo Fengc10a8a42017-12-15 13:56:33 -080038 ],
39 sanitize: {
40 misc_undefined: ["integer"],
41 },
42 },
43 },
44
45 shared_libs: [
46 "libbase",
Chenbo Fengf43bf812017-12-15 18:27:22 -080047 "libutils",
Chenbo Fengc10a8a42017-12-15 13:56:33 -080048 "liblog",
49 "libnetdutils",
50 ],
51 header_libs: [
52 "libbpf_headers"
53 ],
54 export_header_lib_headers: ["libbpf_headers"],
55 local_include_dirs: ["include"],
56
Erik Klineab999f12018-07-04 11:29:31 +090057 // TODO: Enable this once sscanf errors have been fixed.
58 // defaults: ["netd_defaults"],
Chenbo Fengc10a8a42017-12-15 13:56:33 -080059 cflags: [
60 "-Werror",
61 "-Wall",
62 "-Wextra",
63 ],
64}
65
Chenbo Fengdc4e3252017-12-22 11:00:52 -080066cc_test {
67 name: "libbpf_test",
68 srcs: [
69 "BpfNetworkStatsTest.cpp",
Chenbo Feng4f6c2372018-04-26 10:37:55 -070070 "BpfMapTest.cpp",
Chenbo Fengdc4e3252017-12-22 11:00:52 -080071 ],
Erik Klineab999f12018-07-04 11:29:31 +090072 defaults: ["netd_defaults"],
Chenbo Fengdc4e3252017-12-22 11:00:52 -080073 cflags: [
74 "-Wall",
75 "-Werror",
76 "-Wno-error=unused-variable",
77 ],
78 static_libs: ["libgmock"],
79 shared_libs: [
80 "libbpf",
81 "libbase",
82 "liblog",
83 "libnetdutils",
84 "libutils",
85 ],
86}