-
-
Notifications
You must be signed in to change notification settings - Fork 204
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
301 lines (283 loc) · 7.2 KB
/
CMakeLists.txt
File metadata and controls
301 lines (283 loc) · 7.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
sentry_target_sources_cwd(sentry
sentry_alloc.c
sentry_alloc.h
sentry_attachment.c
sentry_attachment.h
sentry_backend.c
sentry_backend.h
sentry_batcher.c
sentry_batcher.h
sentry_boot.h
sentry_core.c
sentry_core.h
sentry_cpu_relax.h
sentry_database.c
sentry_database.h
sentry_envelope.c
sentry_envelope.h
sentry_hint.c
sentry_hint.h
sentry_info.c
sentry_json.c
sentry_json.h
sentry_logger.c
sentry_logger.h
sentry_logs.c
sentry_logs.h
sentry_metrics.c
sentry_metrics.h
sentry_options.c
sentry_options.h
sentry_os.c
sentry_os.h
sentry_path.h
sentry_process.h
sentry_ratelimiter.c
sentry_ratelimiter.h
sentry_ringbuffer.c
sentry_ringbuffer.h
sentry_sampling_context.h
sentry_scope.c
sentry_scope.h
sentry_screenshot.h
sentry_session.c
sentry_session.h
sentry_slice.c
sentry_slice.h
sentry_string.c
sentry_string.h
sentry_symbolizer.h
sentry_sync.c
sentry_sync.h
sentry_transport.c
sentry_transport.h
sentry_utils.c
sentry_utils.h
sentry_uuid.c
sentry_uuid.h
sentry_value.c
sentry_value.h
sentry_tracing.c
sentry_tracing.h
path/sentry_path.c
screenshot/sentry_screenshot.c
transports/sentry_disk_transport.c
transports/sentry_disk_transport.h
transports/sentry_function_transport.c
transports/sentry_http_transport.c
transports/sentry_http_transport.h
unwinder/sentry_unwinder.c
)
# generic platform / path / symbolizer
if(WIN32)
sentry_target_sources_cwd(sentry
sentry_random.c
sentry_random.h
sentry_windows_dbghelp.c
sentry_windows_dbghelp.h
path/sentry_path_windows.c
process/sentry_process_windows.c
symbolizer/sentry_symbolizer_windows.c
)
elseif(NX OR PROSPERO)
sentry_target_sources_cwd(sentry
sentry_unix_spinlock.h
path/sentry_path_unix.c
process/sentry_process_none.c
)
else()
sentry_target_sources_cwd(sentry
sentry_random.c
sentry_random.h
sentry_unix_pageallocator.c
sentry_unix_pageallocator.h
sentry_unix_spinlock.h
symbolizer/sentry_symbolizer_unix.c
path/sentry_path_unix.c
process/sentry_process_unix.c
)
endif()
# module finder
if(WIN32)
sentry_target_sources_cwd(sentry
modulefinder/sentry_modulefinder_windows.c
)
elseif(APPLE)
sentry_target_sources_cwd(sentry
modulefinder/sentry_modulefinder_apple.c
)
elseif(LINUX OR ANDROID)
sentry_target_sources_cwd(sentry
modulefinder/sentry_modulefinder_linux.c
)
elseif(AIX)
sentry_target_sources_cwd(sentry
modulefinder/sentry_modulefinder_aix.c
)
endif()
# transport
if(SENTRY_TRANSPORT_CURL)
sentry_target_sources_cwd(sentry
transports/sentry_http_transport_curl.c
)
elseif(SENTRY_TRANSPORT_WINHTTP)
sentry_target_sources_cwd(sentry
transports/sentry_http_transport_winhttp.c
)
elseif(SENTRY_TRANSPORT_NONE)
sentry_target_sources_cwd(sentry
transports/sentry_transport_none.c
)
endif()
# backends
if(SENTRY_BACKEND_CRASHPAD)
target_compile_definitions(sentry PRIVATE SENTRY_BACKEND_CRASHPAD)
if(MSVC)
target_compile_options(sentry PRIVATE
$<$<COMPILE_LANGUAGE:C,CXX>:/wd4127> # Conditional expression is constant.
)
endif()
sentry_target_sources_cwd(sentry
backends/sentry_backend_crashpad.cpp
)
elseif(SENTRY_BACKEND_BREAKPAD)
target_compile_definitions(sentry PRIVATE SENTRY_BACKEND_BREAKPAD)
sentry_target_sources_cwd(sentry
backends/sentry_backend_breakpad.cpp
)
elseif(SENTRY_BACKEND_INPROC)
target_compile_definitions(sentry PRIVATE SENTRY_BACKEND_INPROC)
sentry_target_sources_cwd(sentry
backends/sentry_backend_inproc.c
)
elseif(SENTRY_BACKEND_NATIVE)
target_compile_definitions(sentry PRIVATE SENTRY_BACKEND_NATIVE)
sentry_target_sources_cwd(sentry
backends/sentry_backend_native.c
backends/native/sentry_crash_ipc.c
backends/native/sentry_crash_daemon.c
backends/native/sentry_crash_handler.c
backends/native/minidump/sentry_minidump_format.h
backends/native/minidump/sentry_minidump_writer.h
)
# Platform-specific minidump writers
if(LINUX OR ANDROID)
sentry_target_sources_cwd(sentry
backends/native/minidump/sentry_minidump_common.c
backends/native/minidump/sentry_minidump_linux.c
)
elseif(APPLE)
sentry_target_sources_cwd(sentry
backends/native/minidump/sentry_minidump_common.c
backends/native/minidump/sentry_minidump_macos.c
)
elseif(WIN32)
sentry_target_sources_cwd(sentry
backends/native/minidump/sentry_minidump_windows.c
)
endif()
# Add include directory for native backend headers
target_include_directories(sentry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/backends/native)
# Platform-specific libraries for native backend
if(LINUX OR ANDROID)
# Linux needs pthread and rt for shared memory
target_link_libraries(sentry PRIVATE pthread rt)
elseif(APPLE)
# macOS needs CoreFoundation and Security frameworks
find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
find_library(SECURITY_LIBRARY Security REQUIRED)
target_link_libraries(sentry PRIVATE
${COREFOUNDATION_LIBRARY}
${SECURITY_LIBRARY}
)
elseif(WIN32)
# Windows needs dbghelp for MiniDumpWriteDump
target_link_libraries(sentry PRIVATE dbghelp)
endif()
# Enable C11 for atomics support
set_property(TARGET sentry PROPERTY C_STANDARD 11)
elseif(SENTRY_BACKEND_NONE)
sentry_target_sources_cwd(sentry
backends/sentry_backend_none.c
)
endif()
# unwinder
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder.h
)
if(SENTRY_WITH_LIBBACKTRACE)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBBACKTRACE)
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder_libbacktrace.c
)
endif()
if(SENTRY_WITH_LIBUNWIND)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBUNWIND)
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder_libunwind.c
)
endif()
if(SENTRY_WITH_LIBUNWIND_MAC)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBUNWIND_MAC)
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder_libunwind_mac.c
)
endif()
if(SENTRY_WITH_LIBUNWINDSTACK)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBUNWINDSTACK)
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder_libunwindstack.cpp
)
endif()
if(WIN32)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_DBGHELP)
sentry_target_sources_cwd(sentry
unwinder/sentry_unwinder_dbghelp.c
)
endif()
if(PROSPERO)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_PS)
endif()
# integrations
if(SENTRY_INTEGRATION_QT)
target_compile_definitions(sentry PRIVATE SENTRY_INTEGRATION_QT)
sentry_target_sources_cwd(sentry
integrations/sentry_integration_qt.cpp
integrations/sentry_integration_qt.h
)
endif()
# screenshot
if(WIN32)
sentry_target_sources_cwd(sentry
screenshot/sentry_screenshot_windows.c
)
else()
sentry_target_sources_cwd(sentry
screenshot/sentry_screenshot_none.c
)
endif()
# gpu
if(SENTRY_WITH_GPU_INFO)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_GPU_INFO)
sentry_target_sources_cwd(sentry
sentry_gpu.h
gpu/sentry_gpu_common.c
)
if(WIN32 OR (APPLE AND NOT IOS) OR LINUX)
sentry_target_sources_cwd(sentry
gpu/sentry_gpu_vulkan.h
gpu/sentry_gpu_vulkan.c
)
else()
# For platforms that do not support GPU info gathering, we provide a no-op implementation
sentry_target_sources_cwd(sentry
gpu/sentry_gpu_none.c
)
endif()
else()
sentry_target_sources_cwd(sentry
sentry_gpu.h
gpu/sentry_gpu_common.c
gpu/sentry_gpu_none.c
)
endif()