blob: 05d0353961e9fe6e783f33285f79a2fb2100b721 [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",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070057 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070058 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080059 "Memory.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070060 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080061 ],
62
63 shared_libs: [
64 "libbase",
65 "liblog",
66 ],
67}
68
69cc_library {
70 name: "libunwindstack",
71 defaults: ["libunwindstack_common"],
72}
73
74cc_library {
75 name: "libunwindstack_debug",
76 defaults: ["libunwindstack_common"],
77
78 cflags: [
79 "-UNDEBUG",
80 "-O0",
81 "-g",
82 ],
83}
84
85//-------------------------------------------------------------------------
86// Unit Tests
87//-------------------------------------------------------------------------
88cc_defaults {
89 name: "libunwindstack_test_common",
90 defaults: ["libunwindstack_flags"],
91
92 srcs: [
93 "tests/ArmExidxDecodeTest.cpp",
94 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070095 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070096 "tests/DwarfOpLogTest.cpp",
97 "tests/DwarfOpTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080098 "tests/ElfInterfaceArmTest.cpp",
99 "tests/ElfInterfaceTest.cpp",
100 "tests/ElfTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800101 "tests/LogFake.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -0700102 "tests/MapInfoTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700103 "tests/MapsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800104 "tests/MemoryFake.cpp",
105 "tests/MemoryFileTest.cpp",
106 "tests/MemoryLocalTest.cpp",
107 "tests/MemoryRangeTest.cpp",
108 "tests/MemoryRemoteTest.cpp",
109 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700110 "tests/SymbolsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800111 ],
112
113 cflags: [
114 "-O0",
115 "-g",
116 ],
117
118 shared_libs: [
119 "libbase",
120 "liblog",
121 ],
122
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800123 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800124 linux: {
125 host_ldlibs: [
126 "-lrt",
127 ],
128 },
129 },
130}
131
132// These unit tests run against the shared library.
133cc_test {
134 name: "libunwindstack_test",
135 defaults: ["libunwindstack_test_common"],
136
137 shared_libs: [
138 "libunwindstack",
139 ],
140}
141
142// These unit tests run against the static debug library.
143cc_test {
144 name: "libunwindstack_test_debug",
145 defaults: ["libunwindstack_test_common"],
146
147 static_libs: [
148 "libunwindstack_debug",
149 ],
150}
Christopher Ferris3958f802017-02-01 15:44:40 -0800151
152//-------------------------------------------------------------------------
153// Utility Executables
154//-------------------------------------------------------------------------
155cc_defaults {
156 name: "libunwindstack_executables",
157 defaults: ["libunwindstack_flags"],
158
159 shared_libs: [
160 "libunwindstack",
161 "libbase",
162 ],
163
164 static_libs: [
165 "liblog",
166 ],
167
168 compile_multilib: "both",
169}
170
171cc_binary {
172 name: "unwind_info",
173 defaults: ["libunwindstack_executables"],
174
175 srcs: [
176 "unwind_info.cpp",
177 ],
178}