blob: d7e949bad2b98c235648a886984a4279846596b9 [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 Ferris61d40972017-06-12 19:14:20 -070051 "DwarfDebugFrame.cpp",
52 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070053 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070054 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070055 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080056 "Elf.cpp",
57 "ElfInterface.cpp",
58 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080059 "Log.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080060 "Regs.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070061 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070062 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080063 "Memory.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070064 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080065 ],
66
67 shared_libs: [
68 "libbase",
69 "liblog",
70 ],
71}
72
73cc_library {
74 name: "libunwindstack",
75 defaults: ["libunwindstack_common"],
76}
77
78cc_library {
79 name: "libunwindstack_debug",
80 defaults: ["libunwindstack_common"],
81
82 cflags: [
83 "-UNDEBUG",
84 "-O0",
85 "-g",
86 ],
87}
88
89//-------------------------------------------------------------------------
90// Unit Tests
91//-------------------------------------------------------------------------
92cc_defaults {
93 name: "libunwindstack_test_common",
94 defaults: ["libunwindstack_flags"],
95
96 srcs: [
97 "tests/ArmExidxDecodeTest.cpp",
98 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070099 "tests/DwarfCfaLogTest.cpp",
100 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -0700101 "tests/DwarfDebugFrameTest.cpp",
102 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -0700103 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -0700104 "tests/DwarfOpLogTest.cpp",
105 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700106 "tests/DwarfSectionTest.cpp",
107 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800108 "tests/ElfInterfaceArmTest.cpp",
109 "tests/ElfInterfaceTest.cpp",
110 "tests/ElfTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800111 "tests/LogFake.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -0700112 "tests/MapInfoTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700113 "tests/MapsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800114 "tests/MemoryFake.cpp",
115 "tests/MemoryFileTest.cpp",
116 "tests/MemoryLocalTest.cpp",
117 "tests/MemoryRangeTest.cpp",
118 "tests/MemoryRemoteTest.cpp",
119 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700120 "tests/SymbolsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800121 ],
122
123 cflags: [
124 "-O0",
125 "-g",
126 ],
127
128 shared_libs: [
129 "libbase",
130 "liblog",
131 ],
132
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700133 static_libs: [
134 "libgmock",
135 ],
136
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800137 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800138 linux: {
139 host_ldlibs: [
140 "-lrt",
141 ],
142 },
143 },
144}
145
146// These unit tests run against the shared library.
147cc_test {
148 name: "libunwindstack_test",
149 defaults: ["libunwindstack_test_common"],
150
151 shared_libs: [
152 "libunwindstack",
153 ],
154}
155
156// These unit tests run against the static debug library.
157cc_test {
158 name: "libunwindstack_test_debug",
159 defaults: ["libunwindstack_test_common"],
160
161 static_libs: [
162 "libunwindstack_debug",
163 ],
164}
Christopher Ferris3958f802017-02-01 15:44:40 -0800165
166//-------------------------------------------------------------------------
167// Utility Executables
168//-------------------------------------------------------------------------
169cc_defaults {
170 name: "libunwindstack_executables",
171 defaults: ["libunwindstack_flags"],
172
173 shared_libs: [
174 "libunwindstack",
175 "libbase",
176 ],
177
178 static_libs: [
179 "liblog",
180 ],
181
182 compile_multilib: "both",
183}
184
185cc_binary {
186 name: "unwind_info",
187 defaults: ["libunwindstack_executables"],
188
189 srcs: [
190 "unwind_info.cpp",
191 ],
192}