blob: eb2b902296cc8d79af6bae66e5fa3785e4ac87a7 [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 Ferris8642fcb2017-04-24 11:14:39 -070050 "DwarfCfa.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070051 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070052 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070053 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080054 "Elf.cpp",
55 "ElfInterface.cpp",
56 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080057 "Log.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080058 "Regs.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070059 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070060 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080061 "Memory.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070062 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080063 ],
64
65 shared_libs: [
66 "libbase",
67 "liblog",
68 ],
69}
70
71cc_library {
72 name: "libunwindstack",
73 defaults: ["libunwindstack_common"],
74}
75
76cc_library {
77 name: "libunwindstack_debug",
78 defaults: ["libunwindstack_common"],
79
80 cflags: [
81 "-UNDEBUG",
82 "-O0",
83 "-g",
84 ],
85}
86
87//-------------------------------------------------------------------------
88// Unit Tests
89//-------------------------------------------------------------------------
90cc_defaults {
91 name: "libunwindstack_test_common",
92 defaults: ["libunwindstack_flags"],
93
94 srcs: [
95 "tests/ArmExidxDecodeTest.cpp",
96 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070097 "tests/DwarfCfaLogTest.cpp",
98 "tests/DwarfCfaTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070099 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -0700100 "tests/DwarfOpLogTest.cpp",
101 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700102 "tests/DwarfSectionTest.cpp",
103 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800104 "tests/ElfInterfaceArmTest.cpp",
105 "tests/ElfInterfaceTest.cpp",
106 "tests/ElfTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800107 "tests/LogFake.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -0700108 "tests/MapInfoTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700109 "tests/MapsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800110 "tests/MemoryFake.cpp",
111 "tests/MemoryFileTest.cpp",
112 "tests/MemoryLocalTest.cpp",
113 "tests/MemoryRangeTest.cpp",
114 "tests/MemoryRemoteTest.cpp",
115 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700116 "tests/SymbolsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800117 ],
118
119 cflags: [
120 "-O0",
121 "-g",
122 ],
123
124 shared_libs: [
125 "libbase",
126 "liblog",
127 ],
128
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700129 static_libs: [
130 "libgmock",
131 ],
132
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800133 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800134 linux: {
135 host_ldlibs: [
136 "-lrt",
137 ],
138 },
139 },
140}
141
142// These unit tests run against the shared library.
143cc_test {
144 name: "libunwindstack_test",
145 defaults: ["libunwindstack_test_common"],
146
147 shared_libs: [
148 "libunwindstack",
149 ],
150}
151
152// These unit tests run against the static debug library.
153cc_test {
154 name: "libunwindstack_test_debug",
155 defaults: ["libunwindstack_test_common"],
156
157 static_libs: [
158 "libunwindstack_debug",
159 ],
160}
Christopher Ferris3958f802017-02-01 15:44:40 -0800161
162//-------------------------------------------------------------------------
163// Utility Executables
164//-------------------------------------------------------------------------
165cc_defaults {
166 name: "libunwindstack_executables",
167 defaults: ["libunwindstack_flags"],
168
169 shared_libs: [
170 "libunwindstack",
171 "libbase",
172 ],
173
174 static_libs: [
175 "liblog",
176 ],
177
178 compile_multilib: "both",
179}
180
181cc_binary {
182 name: "unwind_info",
183 defaults: ["libunwindstack_executables"],
184
185 srcs: [
186 "unwind_info.cpp",
187 ],
188}