|
1 |
| -if (LINUX OR ANDROID) |
2 |
| -# The list is copied from: https://github.com/google/breakpad/blob/c7522272ffafa9b162f135aaee5d02a8895fcb0b/Makefile.am#L153-L188 |
3 |
| - list(APPEND BREAKPAD_SOURCES |
4 |
| - breakpad/src/client/linux/crash_generation/crash_generation_client.cc |
5 |
| - breakpad/src/client/linux/crash_generation/crash_generation_server.cc |
6 |
| - breakpad/src/client/linux/dump_writer_common/thread_info.cc |
7 |
| - breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc |
8 |
| - breakpad/src/client/linux/handler/exception_handler.cc |
9 |
| - breakpad/src/client/linux/handler/exception_handler.h |
10 |
| - breakpad/src/client/linux/handler/minidump_descriptor.cc |
11 |
| - breakpad/src/client/linux/handler/minidump_descriptor.h |
12 |
| - breakpad/src/client/linux/log/log.cc |
13 |
| - breakpad/src/client/linux/log/log.h |
14 |
| - breakpad/src/client/linux/microdump_writer/microdump_writer.cc |
15 |
| - breakpad/src/client/linux/microdump_writer/microdump_writer.h |
16 |
| - breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc |
17 |
| - breakpad/src/client/linux/minidump_writer/linux_dumper.cc |
18 |
| - breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc |
19 |
| - breakpad/src/client/linux/minidump_writer/minidump_writer.cc |
20 |
| - breakpad/src/client/minidump_file_writer-inl.h |
21 |
| - breakpad/src/client/minidump_file_writer.cc |
22 |
| - breakpad/src/client/minidump_file_writer.h |
23 |
| - breakpad/src/common/convert_UTF.cc |
24 |
| - breakpad/src/common/convert_UTF.h |
25 |
| - breakpad/src/common/md5.cc |
26 |
| - breakpad/src/common/md5.h |
27 |
| - breakpad/src/common/string_conversion.cc |
28 |
| - breakpad/src/common/string_conversion.h |
29 |
| - breakpad/src/common/linux/elf_core_dump.cc |
30 |
| - breakpad/src/common/linux/elfutils.cc |
31 |
| - breakpad/src/common/linux/elfutils.h |
32 |
| - breakpad/src/common/linux/file_id.cc |
33 |
| - breakpad/src/common/linux/file_id.h |
34 |
| - breakpad/src/common/linux/guid_creator.cc |
35 |
| - breakpad/src/common/linux/guid_creator.h |
36 |
| - breakpad/src/common/linux/linux_libc_support.cc |
37 |
| - breakpad/src/common/linux/memory_mapped_file.cc |
38 |
| - breakpad/src/common/linux/safe_readlink.cc |
39 |
| - ) |
| 1 | +# The list of files is drived from: breakpad/Makefile.am |
| 2 | + |
| 3 | +set(BREAKPAD_SOURCES_COMMON |
| 4 | + breakpad/src/common/convert_UTF.cc |
| 5 | + breakpad/src/common/convert_UTF.h |
| 6 | + breakpad/src/common/md5.cc |
| 7 | + breakpad/src/common/md5.h |
| 8 | + breakpad/src/common/string_conversion.cc |
| 9 | + breakpad/src/common/string_conversion.h |
| 10 | +) |
| 11 | + |
| 12 | +set(BREAKPAD_SOURCES_COMMON_LINUX |
| 13 | + breakpad/src/common/linux/elf_core_dump.cc |
| 14 | + breakpad/src/common/linux/elfutils.cc |
| 15 | + breakpad/src/common/linux/elfutils.h |
| 16 | + breakpad/src/common/linux/file_id.cc |
| 17 | + breakpad/src/common/linux/file_id.h |
| 18 | + breakpad/src/common/linux/guid_creator.cc |
| 19 | + breakpad/src/common/linux/guid_creator.h |
| 20 | + breakpad/src/common/linux/linux_libc_support.cc |
| 21 | + breakpad/src/common/linux/memory_mapped_file.cc |
| 22 | + breakpad/src/common/linux/safe_readlink.cc |
| 23 | +) |
| 24 | + |
| 25 | +set(BREAKPAD_SOURCES_COMMON_LINUX_GETCONTEXT |
| 26 | + breakpad/src/common/linux/breakpad_getcontext.S |
| 27 | +) |
| 28 | + |
| 29 | +set(BREAKPAD_SOURCES_COMMON_WINDOWS |
| 30 | + breakpad/src/common/windows/guid_string.cc |
| 31 | + breakpad/src/common/windows/guid_string.h |
| 32 | +) |
| 33 | + |
| 34 | +set(BREAKPAD_SOURCES_CLIENT_LINUX |
| 35 | + breakpad/src/client/minidump_file_writer-inl.h |
| 36 | + breakpad/src/client/minidump_file_writer.cc |
| 37 | + breakpad/src/client/minidump_file_writer.h |
| 38 | + breakpad/src/client/linux/crash_generation/crash_generation_client.cc |
| 39 | + breakpad/src/client/linux/crash_generation/crash_generation_server.cc |
| 40 | + breakpad/src/client/linux/dump_writer_common/thread_info.cc |
| 41 | + breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc |
| 42 | + breakpad/src/client/linux/handler/exception_handler.cc |
| 43 | + breakpad/src/client/linux/handler/exception_handler.h |
| 44 | + breakpad/src/client/linux/handler/minidump_descriptor.cc |
| 45 | + breakpad/src/client/linux/handler/minidump_descriptor.h |
| 46 | + breakpad/src/client/linux/log/log.cc |
| 47 | + breakpad/src/client/linux/log/log.h |
| 48 | + breakpad/src/client/linux/microdump_writer/microdump_writer.cc |
| 49 | + breakpad/src/client/linux/microdump_writer/microdump_writer.h |
| 50 | + breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc |
| 51 | + breakpad/src/client/linux/minidump_writer/linux_dumper.cc |
| 52 | + breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc |
| 53 | + breakpad/src/client/linux/minidump_writer/minidump_writer.cc |
| 54 | +) |
| 55 | + |
| 56 | +set(BREAKPAD_SOURCES_CLIENT_WINDOWS |
| 57 | + breakpad/src/client/windows/crash_generation/crash_generation_client.cc |
| 58 | + breakpad/src/client/windows/crash_generation/crash_generation_client.h |
| 59 | + breakpad/src/client/windows/handler/exception_handler.cc |
| 60 | + breakpad/src/client/windows/handler/exception_handler.h |
| 61 | +) |
| 62 | + |
| 63 | + |
| 64 | +add_library(breakpad_client STATIC) |
| 65 | +target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON}) |
| 66 | + |
| 67 | +if(LINUX OR ANDROID) |
| 68 | + target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_LINUX} ${BREAKPAD_SOURCES_CLIENT_LINUX}) |
| 69 | + |
| 70 | + include(CheckFunctionExists) |
| 71 | + check_function_exists(getcontext HAVE_GETCONTEXT) |
| 72 | + if(HAVE_GETCONTEXT) |
| 73 | + target_compile_definitions(breakpad_client PRIVATE HAVE_GETCONTEXT) |
| 74 | + else() |
| 75 | + target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_LINUX_GETCONTEXT}) |
| 76 | + endif() |
| 77 | + |
| 78 | + set_property(TARGET breakpad_client PROPERTY POSITION_INDEPENDENT_CODE ON) |
40 | 79 | endif()
|
41 |
| -if (ANDROID) |
42 |
| - list(APPEND BREAKPAD_SOURCES |
43 |
| - breakpad/src/common/android/breakpad_getcontext.S |
44 |
| - ) |
| 80 | + |
| 81 | +if(WIN32) |
| 82 | + target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_WINDOWS} ${BREAKPAD_SOURCES_CLIENT_WINDOWS}) |
| 83 | + target_compile_definitions(breakpad_client PRIVATE _UNICODE) |
| 84 | + |
| 85 | + # set static runtime if enabled |
| 86 | + if(SENTRY_BUILD_RUNTIMESTATIC AND MSVC) |
| 87 | + set_property(TARGET breakpad_client PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") |
| 88 | + endif() |
45 | 89 | endif()
|
46 | 90 |
|
47 |
| -add_library(breakpad_client STATIC ${BREAKPAD_SOURCES}) |
48 |
| -set_property(TARGET breakpad_client PROPERTY POSITION_INDEPENDENT_CODE ON) |
49 | 91 | # breakpad has includes directly to `third_party/lss/...`,
|
50 | 92 | # which are being resolved correctly when we add the current directory to
|
51 | 93 | # the include directories. A giant hack, yes, but it works
|
|
0 commit comments