1// 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 { 18 name: "libbpf_android_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_android", 31 vendor_available: false, 32 host_supported: false, 33 target: { 34 android: { 35 srcs: [ 36 "BpfUtils.cpp", 37 "Loader.cpp", 38 ], 39 sanitize: { 40 misc_undefined: ["integer"], 41 }, 42 }, 43 }, 44 45 shared_libs: [ 46 "libbase", 47 "libutils", 48 "libprocessgroup", 49 "liblog", 50 "libnetdutils", 51 "libbpf", 52 ], 53 header_libs: [ 54 "libbpf_android_headers" 55 ], 56 export_header_lib_headers: ["libbpf_android_headers"], 57 local_include_dirs: ["include"], 58 59 defaults: ["bpf_defaults"], 60 cflags: [ 61 "-Werror", 62 "-Wall", 63 "-Wextra", 64 ], 65} 66 67cc_test { 68 name: "libbpf_android_test", 69 srcs: [ 70 "BpfMapTest.cpp", 71 ], 72 defaults: ["bpf_defaults"], 73 cflags: [ 74 "-Wall", 75 "-Werror", 76 "-Wno-error=unused-variable", 77 ], 78 static_libs: ["libgmock"], 79 shared_libs: [ 80 "libbpf_android", 81 "libbase", 82 "liblog", 83 "libnetdutils", 84 "libutils", 85 ], 86} 87 88cc_test { 89 name: "libbpf_load_test", 90 srcs: [ 91 "BpfLoadTest.cpp", 92 ], 93 defaults: ["bpf_defaults"], 94 cflags: [ 95 "-Wall", 96 "-Werror", 97 "-Wno-error=unused-variable", 98 ], 99 static_libs: ["libgmock"], 100 shared_libs: [ 101 "libbpf_android", 102 "libbpf", 103 "libbase", 104 "liblog", 105 "libnetdutils", 106 "libutils", 107 ], 108 109 required: [ 110 "bpf_load_tp_prog.o", 111 ], 112} 113