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