Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | cc_library_headers { |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 18 | name: "libnetdbpf_headers", |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [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 | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 30 | name: "libnetdbpf", |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 31 | vendor_available: false, |
| 32 | host_supported: false, |
| 33 | target: { |
| 34 | android: { |
| 35 | srcs: [ |
Chenbo Feng | f43bf81 | 2017-12-15 18:27:22 -0800 | [diff] [blame] | 36 | "BpfNetworkStats.cpp" |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 37 | ], |
| 38 | sanitize: { |
| 39 | misc_undefined: ["integer"], |
| 40 | }, |
| 41 | }, |
| 42 | }, |
| 43 | |
| 44 | shared_libs: [ |
| 45 | "libbase", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 46 | "libbpf", |
Chenbo Feng | f43bf81 | 2017-12-15 18:27:22 -0800 | [diff] [blame] | 47 | "libutils", |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 48 | "liblog", |
| 49 | "libnetdutils", |
| 50 | ], |
| 51 | header_libs: [ |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 52 | "libnetdbpf_headers" |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 53 | ], |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 54 | export_header_lib_headers: ["libnetdbpf_headers"], |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 55 | local_include_dirs: ["include"], |
| 56 | |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 57 | defaults: ["netd_defaults"], |
Chenbo Feng | c10a8a4 | 2017-12-15 13:56:33 -0800 | [diff] [blame] | 58 | cflags: [ |
| 59 | "-Werror", |
| 60 | "-Wall", |
| 61 | "-Wextra", |
| 62 | ], |
| 63 | } |
| 64 | |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 65 | cc_test { |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 66 | name: "libnetdbpf_test", |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 67 | srcs: [ |
| 68 | "BpfNetworkStatsTest.cpp", |
| 69 | ], |
Erik Kline | ab999f1 | 2018-07-04 11:29:31 +0900 | [diff] [blame] | 70 | defaults: ["netd_defaults"], |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 71 | cflags: [ |
| 72 | "-Wall", |
| 73 | "-Werror", |
| 74 | "-Wno-error=unused-variable", |
| 75 | ], |
| 76 | static_libs: ["libgmock"], |
| 77 | shared_libs: [ |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 78 | "libbase", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 79 | "libbpf", |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 80 | "liblog", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame^] | 81 | "libnetdbpf", |
Chenbo Feng | dc4e325 | 2017-12-22 11:00:52 -0800 | [diff] [blame] | 82 | "libnetdutils", |
| 83 | "libutils", |
| 84 | ], |
| 85 | } |