ios: Extract common targets to be shared for iOS.

Move some common files out of client and handler for iOS usage.

Bug: crashpad: 31
Change-Id: I1933eaaa7580a81017c52b77dfb636a8fa31ee78
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2851059
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
Justin Cohen 2021-04-27 21:27:09 -04:00 committed by Commit Bot
parent b8d3be9b78
commit b10f07e52e
3 changed files with 80 additions and 33 deletions

View File

@ -16,27 +16,14 @@ import("../build/crashpad_buildconfig.gni")
crashpad_static_library("client") {
sources = [
"annotation.cc",
"annotation.h",
"annotation_list.cc",
"annotation_list.h",
"crash_report_database.cc",
"crash_report_database.h",
"crashpad_client.h",
"crashpad_info.cc",
"crashpad_info.h",
"prune_crash_reports.cc",
"prune_crash_reports.h",
"settings.cc",
"settings.h",
"simple_address_range_bag.h",
"simple_string_dictionary.h",
"simulate_crash.h",
]
if (crashpad_is_mac) {
sources += [
"crash_report_database_mac.mm",
"crashpad_client_mac.cc",
"simulate_crash_mac.cc",
"simulate_crash_mac.h",
@ -45,7 +32,6 @@ crashpad_static_library("client") {
if (crashpad_is_ios) {
sources += [
"crash_report_database_mac.mm",
"crashpad_client_ios.cc",
"simulate_crash_ios.h",
]
@ -62,13 +48,11 @@ crashpad_static_library("client") {
sources += [
"client_argv_handling.cc",
"client_argv_handling.h",
"crashpad_info_note.S",
]
}
if (crashpad_is_win) {
sources += [
"crash_report_database_win.cc",
"crashpad_client_win.cc",
"simulate_crash_win.h",
]
@ -78,18 +62,18 @@ crashpad_static_library("client") {
sources += [ "crashpad_client_fuchsia.cc" ]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [ "crash_report_database_generic.cc" ]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
":common",
"../third_party/mini_chromium:base",
"../util",
]
deps = [ "../third_party/mini_chromium:chromeos_buildflags" ]
deps = [
":common",
"../third_party/mini_chromium:chromeos_buildflags",
]
if (crashpad_is_win) {
libs = [ "rpcrt4.lib" ]
@ -99,6 +83,7 @@ crashpad_static_library("client") {
# TODO(justincohen): Temporary dependency to bring up the iOS client.
if (crashpad_is_ios) {
deps += [
"../handler:common",
"../minidump",
"../snapshot",
]
@ -116,6 +101,43 @@ crashpad_static_library("client") {
}
}
static_library("common") {
sources = [
"annotation.cc",
"annotation.h",
"annotation_list.cc",
"annotation_list.h",
"crash_report_database.cc",
"crash_report_database.h",
"crashpad_info.cc",
"crashpad_info.h",
"settings.cc",
"settings.h",
"simple_address_range_bag.h",
"simple_string_dictionary.h",
]
if (crashpad_is_mac || crashpad_is_ios) {
sources += [ "crash_report_database_mac.mm" ]
}
if (crashpad_is_win) {
sources += [ "crash_report_database_win.cc" ]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [
"crash_report_database_generic.cc",
"crashpad_info_note.S",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
"../third_party/mini_chromium:base",
"../util",
]
deps = [ "../util" ]
}
source_set("client_test") {
testonly = true

View File

@ -16,12 +16,8 @@ import("../build/crashpad_buildconfig.gni")
static_library("handler") {
sources = [
"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",
@ -34,8 +30,6 @@ static_library("handler") {
"mac/crash_report_exception_handler.h",
"mac/exception_handler_server.cc",
"mac/exception_handler_server.h",
"mac/file_limit_annotation.cc",
"mac/file_limit_annotation.h",
]
}
@ -67,12 +61,14 @@ static_library("handler") {
public_configs = [ "..:crashpad_config" ]
public_deps = [
":common",
"../client",
"../third_party/mini_chromium:base",
"../util",
]
deps = [
":common",
"../minidump",
"../snapshot",
"../third_party/mini_chromium:chromeos_buildflags",
@ -94,6 +90,34 @@ if (crashpad_is_android) {
}
}
static_library("common") {
sources = [
"crash_report_upload_thread.cc",
"crash_report_upload_thread.h",
"minidump_to_upload_parameters.cc",
"minidump_to_upload_parameters.h",
]
if (crashpad_is_mac || crashpad_is_ios) {
sources += [
"mac/file_limit_annotation.cc",
"mac/file_limit_annotation.h",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
"../third_party/mini_chromium:base",
"../util",
]
deps = [
"../client:common",
"../snapshot",
"../util",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
source_set("handler_test") {
testonly = true

View File

@ -242,18 +242,15 @@ crashpad_static_library("snapshot") {
public_deps = [ ":context" ]
deps = [
"../client",
"../client:common",
"../compat",
"../minidump:format",
"../third_party/mini_chromium:base",
"../util",
]
if (crashpad_is_ios) {
deps -= [ "../client" ]
}
if (crashpad_is_win) {
deps += [ "../client" ]
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
libs = [ "powrprof.lib" ]
}
@ -423,7 +420,7 @@ source_set("snapshot_test") {
deps = [
":test_support",
"../client",
"../client:common",
"../compat",
"../minidump:format",
"../test",
@ -432,6 +429,10 @@ source_set("snapshot_test") {
"../util",
]
if (crashpad_is_win) {
deps += [ "../client" ]
}
data_deps = [
":crashpad_snapshot_test_module",
":crashpad_snapshot_test_module_large",