forked from chromium/crashpad
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathCMakeLists.txt
123 lines (108 loc) · 3.15 KB
/
CMakeLists.txt
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
add_library(crashpad_handler_lib STATIC
crash_report_upload_thread.cc
crash_report_upload_thread.h
handler_main.cc
handler_main.h
minidump_to_upload_parameters.cc
minidump_to_upload_parameters.h
prune_crash_reports_thread.cc
prune_crash_reports_thread.h
user_stream_data_source.cc
user_stream_data_source.h
)
if(APPLE)
target_sources(crashpad_handler_lib PRIVATE
mac/file_limit_annotation.cc
mac/file_limit_annotation.h
)
endif()
if(APPLE AND NOT IOS)
target_sources(crashpad_handler_lib PRIVATE
mac/crash_report_exception_handler.cc
mac/crash_report_exception_handler.h
mac/exception_handler_server.cc
mac/exception_handler_server.h
)
endif()
if(LINUX OR ANDROID)
target_sources(crashpad_handler_lib PRIVATE
linux/capture_snapshot.cc
linux/capture_snapshot.h
linux/crash_report_exception_handler.cc
linux/crash_report_exception_handler.h
linux/exception_handler_server.cc
linux/exception_handler_server.h
)
endif()
if(LINUX)
target_sources(crashpad_handler_lib PRIVATE
linux/cros_crash_report_exception_handler.cc
linux/cros_crash_report_exception_handler.h
)
endif()
if(WIN32)
target_sources(crashpad_handler_lib PRIVATE
win/crash_report_exception_handler.cc
win/crash_report_exception_handler.h
)
endif()
target_link_libraries(crashpad_handler_lib
PRIVATE
$<BUILD_INTERFACE:crashpad_interface>
PUBLIC
crashpad_compat
crashpad_minidump
crashpad_snapshot
crashpad_util
mini_chromium
)
if(WIN32)
if(MSVC)
target_compile_options(crashpad_handler_lib PRIVATE "/wd4201")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(crashpad_handler_lib PRIVATE
"-Wno-multichar"
)
endif()
set_property(TARGET crashpad_handler_lib PROPERTY EXPORT_NAME handler)
add_library(crashpad::handler_lib ALIAS crashpad_handler_lib)
crashpad_install_target(crashpad_handler_lib)
crashpad_install_dev(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crashpad/handler"
FILES_MATCHING PATTERN "*.h"
)
if(NOT IOS)
add_executable(crashpad_handler WIN32
main.cc
)
if(LINUX)
target_sources(crashpad_handler PRIVATE
../client/pthread_create_linux.cc
)
endif()
target_link_libraries(crashpad_handler
PRIVATE
$<BUILD_INTERFACE:crashpad_interface>
PUBLIC
crashpad_client
crashpad_getopt
crashpad_handler_lib
crashpad_minidump
crashpad_snapshot
crashpad_tools
crashpad_util
mini_chromium
)
if(WIN32)
if(MSVC)
target_link_options(crashpad_handler PRIVATE "/SUBSYSTEM:WINDOWS")
endif()
endif()
set_property(TARGET crashpad_handler PROPERTY EXPORT_NAME crashpad_handler)
add_executable(crashpad::handler ALIAS crashpad_handler)
install(TARGETS crashpad_handler EXPORT crashpad_export
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
endif()