blob: 63768b2851a3faee5ee88f50e9ff00e79d163b7f [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 ],
27}
28
29cc_defaults {
30 name: "libunwindstack_common",
31 defaults: ["libunwindstack_flags"],
32
33 srcs: [
34 "ArmExidx.cpp",
35 "Memory.cpp",
36 "Log.cpp",
37 ],
38
39 shared_libs: [
40 "libbase",
41 "liblog",
42 ],
43}
44
45cc_library {
46 name: "libunwindstack",
47 defaults: ["libunwindstack_common"],
48}
49
50cc_library {
51 name: "libunwindstack_debug",
52 defaults: ["libunwindstack_common"],
53
54 cflags: [
55 "-UNDEBUG",
56 "-O0",
57 "-g",
58 ],
59}
60
61//-------------------------------------------------------------------------
62// Unit Tests
63//-------------------------------------------------------------------------
64cc_defaults {
65 name: "libunwindstack_test_common",
66 defaults: ["libunwindstack_flags"],
67
68 srcs: [
69 "tests/ArmExidxDecodeTest.cpp",
70 "tests/ArmExidxExtractTest.cpp",
71 "tests/LogFake.cpp",
72 "tests/MemoryFake.cpp",
73 "tests/MemoryFileTest.cpp",
74 "tests/MemoryLocalTest.cpp",
75 "tests/MemoryRangeTest.cpp",
76 "tests/MemoryRemoteTest.cpp",
77 "tests/RegsTest.cpp",
78 ],
79
80 cflags: [
81 "-O0",
82 "-g",
83 ],
84
85 shared_libs: [
86 "libbase",
87 "liblog",
88 ],
89
90 multilib: {
91 lib32: {
92 suffix: "32",
93 },
94 lib64: {
95 suffix: "64",
96 },
97 },
98
99 target: {
100 darwin: {
101 enabled: false,
102 },
103 linux: {
104 host_ldlibs: [
105 "-lrt",
106 ],
107 },
108 },
109}
110
111// These unit tests run against the shared library.
112cc_test {
113 name: "libunwindstack_test",
114 defaults: ["libunwindstack_test_common"],
115
116 shared_libs: [
117 "libunwindstack",
118 ],
119}
120
121// These unit tests run against the static debug library.
122cc_test {
123 name: "libunwindstack_test_debug",
124 defaults: ["libunwindstack_test_common"],
125
126 static_libs: [
127 "libunwindstack_debug",
128 ],
129}