1#
2# Copyright 2017 The Abseil Authors.
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#      https://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
17absl_cc_library(
18  NAME
19    stacktrace
20  HDRS
21    "stacktrace.h"
22    "internal/stacktrace_aarch64-inl.inc"
23    "internal/stacktrace_arm-inl.inc"
24    "internal/stacktrace_config.h"
25    "internal/stacktrace_generic-inl.inc"
26    "internal/stacktrace_powerpc-inl.inc"
27    "internal/stacktrace_unimplemented-inl.inc"
28    "internal/stacktrace_win32-inl.inc"
29    "internal/stacktrace_x86-inl.inc"
30  SRCS
31    "stacktrace.cc"
32  COPTS
33    ${ABSL_DEFAULT_COPTS}
34  DEPS
35    absl::debugging_internal
36    absl::config
37    absl::core_headers
38  PUBLIC
39)
40
41absl_cc_library(
42  NAME
43    symbolize
44  HDRS
45    "symbolize.h"
46    "internal/symbolize.h"
47  SRCS
48    "symbolize.cc"
49    "symbolize_darwin.inc"
50    "symbolize_elf.inc"
51    "symbolize_unimplemented.inc"
52    "symbolize_win32.inc"
53  COPTS
54    ${ABSL_DEFAULT_COPTS}
55  LINKOPTS
56    ${ABSL_DEFAULT_LINKOPTS}
57    $<$<BOOL:${MINGW}>:"dbghelp">
58  DEPS
59    absl::debugging_internal
60    absl::demangle_internal
61    absl::base
62    absl::config
63    absl::core_headers
64    absl::dynamic_annotations
65    absl::malloc_internal
66    absl::raw_logging_internal
67    absl::strings
68  PUBLIC
69)
70
71absl_cc_test(
72  NAME
73    symbolize_test
74  SRCS
75    "symbolize_test.cc"
76  COPTS
77    ${ABSL_TEST_COPTS}
78    $<$<BOOL:${MSVC}>:-Z7>
79  LINKOPTS
80    $<$<BOOL:${MSVC}>:-DEBUG>
81  DEPS
82    absl::stack_consumption
83    absl::symbolize
84    absl::base
85    absl::config
86    absl::core_headers
87    absl::memory
88    absl::raw_logging_internal
89    absl::strings
90    gmock
91)
92
93absl_cc_library(
94  NAME
95    examine_stack
96  HDRS
97    "internal/examine_stack.h"
98  SRCS
99    "internal/examine_stack.cc"
100  COPTS
101    ${ABSL_DEFAULT_COPTS}
102  DEPS
103    absl::stacktrace
104    absl::symbolize
105    absl::config
106    absl::core_headers
107    absl::raw_logging_internal
108)
109
110absl_cc_library(
111  NAME
112    failure_signal_handler
113  HDRS
114    "failure_signal_handler.h"
115  SRCS
116    "failure_signal_handler.cc"
117  COPTS
118    ${ABSL_DEFAULT_COPTS}
119  DEPS
120    absl::examine_stack
121    absl::stacktrace
122    absl::base
123    absl::config
124    absl::core_headers
125    absl::errno_saver
126    absl::raw_logging_internal
127  PUBLIC
128)
129
130absl_cc_test(
131  NAME
132    failure_signal_handler_test
133  SRCS
134    "failure_signal_handler_test.cc"
135  COPTS
136    ${ABSL_TEST_COPTS}
137  DEPS
138    absl::failure_signal_handler
139    absl::stacktrace
140    absl::symbolize
141    absl::strings
142    absl::raw_logging_internal
143    Threads::Threads
144    gmock
145)
146
147absl_cc_library(
148  NAME
149    debugging_internal
150  HDRS
151    "internal/address_is_readable.h"
152    "internal/elf_mem_image.h"
153    "internal/vdso_support.h"
154  SRCS
155    "internal/address_is_readable.cc"
156    "internal/elf_mem_image.cc"
157    "internal/vdso_support.cc"
158  COPTS
159    ${ABSL_DEFAULT_COPTS}
160  DEPS
161    absl::core_headers
162    absl::config
163    absl::dynamic_annotations
164    absl::errno_saver
165    absl::raw_logging_internal
166)
167
168absl_cc_library(
169  NAME
170    demangle_internal
171  HDRS
172    "internal/demangle.h"
173  SRCS
174    "internal/demangle.cc"
175  COPTS
176    ${ABSL_DEFAULT_COPTS}
177  DEPS
178    absl::base
179    absl::core_headers
180  PUBLIC
181)
182
183absl_cc_test(
184  NAME
185    demangle_test
186  SRCS
187    "internal/demangle_test.cc"
188  COPTS
189    ${ABSL_TEST_COPTS}
190  DEPS
191    absl::demangle_internal
192    absl::stack_consumption
193    absl::config
194    absl::core_headers
195    absl::memory
196    absl::raw_logging_internal
197    gmock_main
198)
199
200absl_cc_library(
201  NAME
202    leak_check
203  HDRS
204    "leak_check.h"
205  SRCS
206    "leak_check.cc"
207  COPTS
208    ${ABSL_DEFAULT_COPTS}
209  DEPS
210    absl::config
211    absl::core_headers
212  PUBLIC
213)
214
215absl_cc_library(
216  NAME
217    leak_check_disable
218  SRCS
219    "leak_check_disable.cc"
220  COPTS
221    ${ABSL_DEFAULT_COPTS}
222  PUBLIC
223)
224
225absl_cc_library(
226  NAME
227    leak_check_api_enabled_for_testing
228  HDRS
229    "leak_check.h"
230  SRCS
231    "leak_check.cc"
232  COPTS
233    ${ABSL_DEFAULT_COPTS}
234    $<$<BOOL:${ABSL_HAVE_LSAN}>:-DLEAK_SANITIZER>
235  TESTONLY
236)
237
238absl_cc_library(
239  NAME
240    leak_check_api_disabled_for_testing
241  HDRS
242    "leak_check.h"
243  SRCS
244    "leak_check.cc"
245  COPTS
246    ${ABSL_DEFAULT_COPTS}
247    "-ULEAK_SANITIZER"
248  TESTONLY
249)
250
251absl_cc_test(
252  NAME
253    leak_check_test
254  SRCS
255    "leak_check_test.cc"
256  COPTS
257    ${ABSL_TEST_COPTS}
258    "$<$<BOOL:${ABSL_HAVE_LSAN}>:-DABSL_EXPECT_LEAK_SANITIZER>"
259  LINKOPTS
260    "${ABSL_LSAN_LINKOPTS}"
261  DEPS
262    absl::leak_check_api_enabled_for_testing
263    absl::base
264    gmock_main
265)
266
267absl_cc_test(
268  NAME
269    leak_check_no_lsan_test
270  SRCS
271    "leak_check_test.cc"
272  COPTS
273    ${ABSL_TEST_COPTS}
274    "-UABSL_EXPECT_LEAK_SANITIZER"
275  DEPS
276    absl::leak_check_api_disabled_for_testing
277    absl::base
278    gmock_main
279)
280
281absl_cc_test(
282  NAME
283    disabled_leak_check_test
284  SRCS
285    "leak_check_fail_test.cc"
286  COPTS
287    ${ABSL_TEST_COPTS}
288  LINKOPTS
289    "${ABSL_LSAN_LINKOPTS}"
290  DEPS
291    absl::leak_check_api_enabled_for_testing
292    absl::leak_check_disable
293    absl::base
294    absl::raw_logging_internal
295    gmock_main
296)
297
298absl_cc_library(
299  NAME
300    stack_consumption
301  HDRS
302    "internal/stack_consumption.h"
303  SRCS
304    "internal/stack_consumption.cc"
305  COPTS
306    ${ABSL_DEFAULT_COPTS}
307  DEPS
308    absl::config
309    absl::core_headers
310    absl::raw_logging_internal
311  TESTONLY
312)
313
314absl_cc_test(
315  NAME
316    stack_consumption_test
317  SRCS
318    "internal/stack_consumption_test.cc"
319  COPTS
320    ${ABSL_TEST_COPTS}
321  DEPS
322    absl::stack_consumption
323    absl::core_headers
324    absl::raw_logging_internal
325    gmock_main
326)
327
328# component target
329absl_cc_library(
330  NAME
331    debugging
332  COPTS
333    ${ABSL_DEFAULT_COPTS}
334  DEPS
335    absl::stacktrace
336    absl::leak_check
337  PUBLIC
338)
339