Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +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 | package { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | cc_library { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 22 | name: "libnetworkstats", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 23 | vendor_available: false, |
| 24 | host_supported: false, |
| 25 | header_libs: ["bpf_connectivity_headers"], |
| 26 | srcs: [ |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 27 | "BpfNetworkStats.cpp", |
| 28 | "NetworkTraceHandler.cpp", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 29 | ], |
| 30 | shared_libs: [ |
| 31 | "libbase", |
| 32 | "liblog", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 33 | ], |
| 34 | export_include_dirs: ["include"], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 35 | cflags: [ |
| 36 | "-Wall", |
| 37 | "-Werror", |
| 38 | "-Wno-unused-parameter", |
| 39 | "-Wthread-safety", |
| 40 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 41 | sanitize: { |
| 42 | cfi: true, |
| 43 | }, |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 44 | apex_available: [ |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 45 | "com.android.tethering", |
| 46 | ], |
| 47 | min_sdk_version: "30", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | cc_test { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 51 | name: "libnetworkstats_test", |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 52 | test_suites: ["general-tests", "mts-tethering"], |
| 53 | test_config_template: ":net_native_test_config_template", |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 54 | require_root: true, // required by setrlimitForTest() |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 55 | header_libs: ["bpf_connectivity_headers"], |
| 56 | srcs: [ |
| 57 | "BpfNetworkStatsTest.cpp", |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 58 | "NetworkTraceHandlerTest.cpp", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 59 | ], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 60 | cflags: [ |
| 61 | "-Wall", |
| 62 | "-Werror", |
| 63 | "-Wno-unused-parameter", |
| 64 | "-Wthread-safety", |
| 65 | ], |
Lorenzo Colitti | 0db496e | 2022-02-07 09:01:37 +0900 | [diff] [blame] | 66 | static_libs: [ |
| 67 | "libgmock", |
| 68 | "libnetworkstats", |
| 69 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 70 | shared_libs: [ |
| 71 | "libbase", |
| 72 | "liblog", |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 73 | "libandroid_net", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 74 | ], |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 75 | compile_multilib: "both", |
| 76 | multilib: { |
| 77 | lib32: { |
| 78 | suffix: "32", |
| 79 | }, |
| 80 | lib64: { |
| 81 | suffix: "64", |
| 82 | }, |
| 83 | }, |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 84 | } |