blob: ee646de410b4cbd723e6a877baf5eae604bcbf3a [file] [log] [blame]
Christopher Ferris723cf9b2017-01-19 20:08:48 -08001//
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
17cc_defaults {
18 name: "libunwindstack_flags",
19
20 host_supported: true,
21
22 cflags: [
23 "-Wall",
24 "-Werror",
25 "-Wextra",
26 ],
Christopher Ferris01d50372017-01-30 13:45:16 -080027
28 target: {
29 darwin: {
30 enabled: false,
31 },
32 },
Christopher Ferris3958f802017-02-01 15:44:40 -080033
34 multilib: {
35 lib32: {
36 suffix: "32",
37 },
38 lib64: {
39 suffix: "64",
40 },
41 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080042}
43
44cc_defaults {
45 name: "libunwindstack_common",
46 defaults: ["libunwindstack_flags"],
47
48 srcs: [
49 "ArmExidx.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070050 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070051 "DwarfOp.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080052 "Elf.cpp",
53 "ElfInterface.cpp",
54 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080055 "Log.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080056 "Regs.cpp",
57 "Memory.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070058 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080059 ],
60
61 shared_libs: [
62 "libbase",
63 "liblog",
64 ],
65}
66
67cc_library {
68 name: "libunwindstack",
69 defaults: ["libunwindstack_common"],
70}
71
72cc_library {
73 name: "libunwindstack_debug",
74 defaults: ["libunwindstack_common"],
75
76 cflags: [
77 "-UNDEBUG",
78 "-O0",
79 "-g",
80 ],
81}
82
83//-------------------------------------------------------------------------
84// Unit Tests
85//-------------------------------------------------------------------------
86cc_defaults {
87 name: "libunwindstack_test_common",
88 defaults: ["libunwindstack_flags"],
89
90 srcs: [
91 "tests/ArmExidxDecodeTest.cpp",
92 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070093 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070094 "tests/DwarfOpLogTest.cpp",
95 "tests/DwarfOpTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080096 "tests/ElfInterfaceArmTest.cpp",
97 "tests/ElfInterfaceTest.cpp",
98 "tests/ElfTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080099 "tests/LogFake.cpp",
100 "tests/MemoryFake.cpp",
101 "tests/MemoryFileTest.cpp",
102 "tests/MemoryLocalTest.cpp",
103 "tests/MemoryRangeTest.cpp",
104 "tests/MemoryRemoteTest.cpp",
105 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700106 "tests/SymbolsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800107 ],
108
109 cflags: [
110 "-O0",
111 "-g",
112 ],
113
114 shared_libs: [
115 "libbase",
116 "liblog",
117 ],
118
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800119 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800120 linux: {
121 host_ldlibs: [
122 "-lrt",
123 ],
124 },
125 },
126}
127
128// These unit tests run against the shared library.
129cc_test {
130 name: "libunwindstack_test",
131 defaults: ["libunwindstack_test_common"],
132
133 shared_libs: [
134 "libunwindstack",
135 ],
136}
137
138// These unit tests run against the static debug library.
139cc_test {
140 name: "libunwindstack_test_debug",
141 defaults: ["libunwindstack_test_common"],
142
143 static_libs: [
144 "libunwindstack_debug",
145 ],
146}
Christopher Ferris3958f802017-02-01 15:44:40 -0800147
148//-------------------------------------------------------------------------
149// Utility Executables
150//-------------------------------------------------------------------------
151cc_defaults {
152 name: "libunwindstack_executables",
153 defaults: ["libunwindstack_flags"],
154
155 shared_libs: [
156 "libunwindstack",
157 "libbase",
158 ],
159
160 static_libs: [
161 "liblog",
162 ],
163
164 compile_multilib: "both",
165}
166
167cc_binary {
168 name: "unwind_info",
169 defaults: ["libunwindstack_executables"],
170
171 srcs: [
172 "unwind_info.cpp",
173 ],
174}