blob: 17ede51633f2553bd723015dec3b2539f8ff987b [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 Ferris723cf9b2017-01-19 20:08:48 -080058 ],
59
60 shared_libs: [
61 "libbase",
62 "liblog",
63 ],
64}
65
66cc_library {
67 name: "libunwindstack",
68 defaults: ["libunwindstack_common"],
69}
70
71cc_library {
72 name: "libunwindstack_debug",
73 defaults: ["libunwindstack_common"],
74
75 cflags: [
76 "-UNDEBUG",
77 "-O0",
78 "-g",
79 ],
80}
81
82//-------------------------------------------------------------------------
83// Unit Tests
84//-------------------------------------------------------------------------
85cc_defaults {
86 name: "libunwindstack_test_common",
87 defaults: ["libunwindstack_flags"],
88
89 srcs: [
90 "tests/ArmExidxDecodeTest.cpp",
91 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070092 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070093 "tests/DwarfOpLogTest.cpp",
94 "tests/DwarfOpTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080095 "tests/ElfInterfaceArmTest.cpp",
96 "tests/ElfInterfaceTest.cpp",
97 "tests/ElfTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080098 "tests/LogFake.cpp",
99 "tests/MemoryFake.cpp",
100 "tests/MemoryFileTest.cpp",
101 "tests/MemoryLocalTest.cpp",
102 "tests/MemoryRangeTest.cpp",
103 "tests/MemoryRemoteTest.cpp",
104 "tests/RegsTest.cpp",
105 ],
106
107 cflags: [
108 "-O0",
109 "-g",
110 ],
111
112 shared_libs: [
113 "libbase",
114 "liblog",
115 ],
116
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800117 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800118 linux: {
119 host_ldlibs: [
120 "-lrt",
121 ],
122 },
123 },
124}
125
126// These unit tests run against the shared library.
127cc_test {
128 name: "libunwindstack_test",
129 defaults: ["libunwindstack_test_common"],
130
131 shared_libs: [
132 "libunwindstack",
133 ],
134}
135
136// These unit tests run against the static debug library.
137cc_test {
138 name: "libunwindstack_test_debug",
139 defaults: ["libunwindstack_test_common"],
140
141 static_libs: [
142 "libunwindstack_debug",
143 ],
144}
Christopher Ferris3958f802017-02-01 15:44:40 -0800145
146//-------------------------------------------------------------------------
147// Utility Executables
148//-------------------------------------------------------------------------
149cc_defaults {
150 name: "libunwindstack_executables",
151 defaults: ["libunwindstack_flags"],
152
153 shared_libs: [
154 "libunwindstack",
155 "libbase",
156 ],
157
158 static_libs: [
159 "liblog",
160 ],
161
162 compile_multilib: "both",
163}
164
165cc_binary {
166 name: "unwind_info",
167 defaults: ["libunwindstack_executables"],
168
169 srcs: [
170 "unwind_info.cpp",
171 ],
172}