blob: 8c480965040b0970aed47dbc80805d2e44c8ab8a [file] [log] [blame]
Yabin Cuie1deac52018-01-23 15:04:44 -08001//
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
17cc_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 Cuie1deac52018-01-23 15:04:44 -080036 ],
37 cppflags: [
38 "-Wno-sign-compare",
39 "-Wno-unused-parameter",
40 ],
41}
42
43cc_library_static {
44 name: "libsimpleperf_elf_read",
45 defaults: [
46 "simpleperf_defaults",
47 ],
Andreas Gampe98d04ad2018-03-08 13:49:27 -080048 host_supported: true,
Yabin Cuie1deac52018-01-23 15:04:44 -080049
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 Gampe98d04ad2018-03-08 13:49:27 -080092}