Joel Fernandes | 3b76779 | 2018-10-31 17:31:45 -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_defaults { |
| 18 | name: "libbpf_defaults", |
| 19 | cpp_std: "c++17", |
| 20 | cflags: [ |
| 21 | "-Wall", |
| 22 | "-Werror", |
| 23 | "-Wnullable-to-nonnull-conversion", |
| 24 | "-Wthread-safety", |
| 25 | "-Wunused-parameter", |
| 26 | ], |
| 27 | tidy: true, |
| 28 | tidy_checks: [ |
| 29 | "android-*", |
| 30 | "cert-*", |
| 31 | "clang-analyzer-security*", |
| 32 | // Disabling due to many unavoidable warnings from POSIX API usage. |
| 33 | "-google-runtime-int", |
| 34 | ], |
| 35 | } |
| 36 | |
| 37 | cc_library_headers { |
| 38 | name: "libbpf_headers", |
| 39 | vendor_available: false, |
| 40 | host_supported: false, |
| 41 | export_include_dirs: ["src/cc/includes/"], |
| 42 | target: { |
| 43 | linux_bionic: { |
| 44 | enabled: true, |
| 45 | }, |
| 46 | }, |
| 47 | } |
| 48 | |
| 49 | cc_library { |
| 50 | name: "libbpf", |
| 51 | vendor_available: false, |
| 52 | host_supported: false, |
| 53 | target: { |
| 54 | android: { |
| 55 | srcs: [ |
| 56 | "src/cc/libbpf.c", |
| 57 | "src/cc/perf_reader.c", |
| 58 | ], |
| 59 | sanitize: { |
| 60 | misc_undefined: ["integer"], |
| 61 | }, |
| 62 | }, |
| 63 | }, |
| 64 | |
| 65 | header_libs: [ |
| 66 | "libbpf_headers" |
| 67 | ], |
| 68 | export_header_lib_headers: ["libbpf_headers"], |
| 69 | local_include_dirs: ["src/cc"], |
| 70 | |
| 71 | defaults: ["bpf_defaults"], |
| 72 | cflags: [ |
| 73 | "-Werror", |
| 74 | "-Wall", |
| 75 | "-Wextra", |
| 76 | ], |
| 77 | } |