Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 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 | |
| 17 | cc_library_headers { |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 18 | name: "libbpf_android_headers", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 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 | |
| 29 | cc_library { |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 30 | name: "libbpf_android", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 31 | vendor_available: false, |
| 32 | host_supported: false, |
| 33 | target: { |
| 34 | android: { |
| 35 | srcs: [ |
| 36 | "BpfUtils.cpp", |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 37 | "Loader.cpp", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 38 | ], |
| 39 | sanitize: { |
| 40 | misc_undefined: ["integer"], |
| 41 | }, |
| 42 | }, |
| 43 | }, |
| 44 | |
| 45 | shared_libs: [ |
| 46 | "libbase", |
| 47 | "libutils", |
Zhijun He | 855cf18 | 2019-06-19 04:44:24 +0000 | [diff] [blame] | 48 | "libprocessgroup", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 49 | "liblog", |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 50 | "libbpf", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 51 | ], |
| 52 | header_libs: [ |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 53 | "libbpf_android_headers" |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 54 | ], |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 55 | export_header_lib_headers: ["libbpf_android_headers"], |
Steven Moreland | 4891e61 | 2020-01-10 15:35:52 -0800 | [diff] [blame] | 56 | export_shared_lib_headers: ["libbpf"], |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 57 | local_include_dirs: ["include"], |
| 58 | |
| 59 | defaults: ["bpf_defaults"], |
| 60 | cflags: [ |
| 61 | "-Werror", |
| 62 | "-Wall", |
| 63 | "-Wextra", |
| 64 | ], |
| 65 | } |
| 66 | |
| 67 | cc_test { |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 68 | name: "libbpf_android_test", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 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: [ |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 80 | "libbpf_android", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 81 | "libbase", |
| 82 | "liblog", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 83 | "libutils", |
| 84 | ], |
Maciej Żenczykowski | 1a4659c | 2019-09-19 14:36:19 -0700 | [diff] [blame] | 85 | require_root: true, |
Steven Moreland | b572378 | 2020-01-14 11:39:16 -0800 | [diff] [blame] | 86 | test_suites: ["general-tests"], |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 87 | } |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 88 | |
| 89 | cc_test { |
| 90 | name: "libbpf_load_test", |
| 91 | srcs: [ |
| 92 | "BpfLoadTest.cpp", |
| 93 | ], |
| 94 | defaults: ["bpf_defaults"], |
| 95 | cflags: [ |
| 96 | "-Wall", |
| 97 | "-Werror", |
| 98 | "-Wno-error=unused-variable", |
| 99 | ], |
| 100 | static_libs: ["libgmock"], |
| 101 | shared_libs: [ |
| 102 | "libbpf_android", |
| 103 | "libbpf", |
| 104 | "libbase", |
| 105 | "liblog", |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 106 | "libutils", |
| 107 | ], |
| 108 | |
| 109 | required: [ |
| 110 | "bpf_load_tp_prog.o", |
| 111 | ], |
Steven Moreland | cdeb920 | 2020-01-14 11:36:43 -0800 | [diff] [blame] | 112 | require_root: true, |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 113 | } |