| Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [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: "simpleperf_defaults", |
| 19 | |
| 20 | cflags: [ |
| 21 | "-Wall", |
| 22 | "-Wextra", |
| 23 | "-Werror", |
| 24 | |
| 25 | // Try some more extreme warnings. |
| 26 | "-Wpedantic", |
| 27 | "-Wunreachable-code-aggressive", |
| 28 | // And disable some dumb things. |
| 29 | "-Wno-zero-length-array", |
| 30 | "-Wno-c99-extensions", |
| 31 | "-Wno-language-extension-token", |
| 32 | "-Wno-gnu-zero-variadic-macro-arguments", |
| 33 | "-Wno-nested-anon-types", |
| 34 | "-Wno-gnu-statement-expression", |
| 35 | "-Wno-vla-extension", |
| Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 36 | ], |
| 37 | cppflags: [ |
| 38 | "-Wno-sign-compare", |
| 39 | "-Wno-unused-parameter", |
| 40 | ], |
| 41 | } |
| 42 | |
| 43 | cc_library_static { |
| 44 | name: "libsimpleperf_elf_read", |
| 45 | defaults: [ |
| 46 | "simpleperf_defaults", |
| 47 | ], |
| Andreas Gampe | 98d04ad | 2018-03-08 13:49:27 -0800 | [diff] [blame] | 48 | host_supported: true, |
| Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 49 | |
| 50 | export_include_dirs: [ |
| 51 | ".", |
| 52 | ], |
| 53 | |
| 54 | // TODO: fix or workaround this. |
| 55 | cflags: [ |
| 56 | "-DSIMPLEPERF_REVISION=\"dummy\"", |
| 57 | ], |
| 58 | |
| 59 | static_libs: [ |
| 60 | "libbase", |
| 61 | ], |
| 62 | // Use whole-static to avoid having to pull this in later. |
| 63 | whole_static_libs: [ |
| 64 | "libLLVMObject", |
| 65 | "libLLVMBitReader", |
| 66 | "libLLVMMC", |
| 67 | "libLLVMMCParser", |
| 68 | "libLLVMCore", |
| 69 | "libLLVMSupport", |
| 70 | "liblog", |
| 71 | "liblzma", |
| 72 | "libz", |
| 73 | "libziparchive", |
| 74 | ], |
| 75 | |
| 76 | target: { |
| 77 | // Required for LLVM. |
| 78 | linux_glibc: { |
| 79 | host_ldlibs: [ |
| 80 | "-lncurses", |
| 81 | ], |
| 82 | }, |
| 83 | }, |
| 84 | |
| 85 | srcs: [ |
| 86 | "read_apk.cpp", |
| 87 | "read_elf.cpp", |
| 88 | "utils.cpp", |
| 89 | ], |
| 90 | |
| 91 | group_static_libs: true, |
| Andreas Gampe | 98d04ad | 2018-03-08 13:49:27 -0800 | [diff] [blame] | 92 | } |