2017-11-17 17:48:22 -08:00
|
|
|
|
# Copyright 2015 The Crashpad Authors. All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
import("//testing/test.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",
|
|
|
|
|
"user_stream_data_source.h",
|
|
|
|
|
]
|
|
|
|
|
|
2017-11-28 10:31:13 -08:00
|
|
|
|
if (is_mac) {
|
|
|
|
|
sources += [
|
|
|
|
|
"mac/crash_report_exception_handler.cc",
|
|
|
|
|
"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",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
sources += [
|
|
|
|
|
"win/crash_report_exception_handler.cc",
|
|
|
|
|
"win/crash_report_exception_handler.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-06 10:08:11 -08:00
|
|
|
|
if (is_fuchsia) {
|
|
|
|
|
sources += [
|
|
|
|
|
"fuchsia/crash_report_exception_handler.cc",
|
|
|
|
|
"fuchsia/crash_report_exception_handler.h",
|
|
|
|
|
"fuchsia/exception_handler_server.cc",
|
|
|
|
|
"fuchsia/exception_handler_server.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-28 10:31:13 -08:00
|
|
|
|
public_configs = [ "..:crashpad_config" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../minidump",
|
|
|
|
|
"../snapshot",
|
|
|
|
|
"../tools:tool_support",
|
|
|
|
|
"../util",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"//base",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
source_set("handler_test") {
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
|
"minidump_to_upload_parameters_test.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../snapshot",
|
2017-12-06 10:08:11 -08:00
|
|
|
|
"../snapshot:test_support",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../test",
|
|
|
|
|
"../util",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"//base",
|
|
|
|
|
"//testing/gtest",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
sources += [ "crashpad_handler_test.cc" ]
|
|
|
|
|
|
|
|
|
|
data_deps = [
|
|
|
|
|
":crashpad_handler_test_extended_handler",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
executable("crashpad_handler") {
|
|
|
|
|
sources = [
|
|
|
|
|
"main.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../compat",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"//base",
|
|
|
|
|
"//build/win:default_exe_manifest",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if (is_mac && is_component_build) {
|
|
|
|
|
ldflags = [
|
|
|
|
|
# The handler is in
|
|
|
|
|
# Chromium.app/Contents/Versions/X/Chromium Framework.framework/Versions/A/Helpers/
|
|
|
|
|
# so set rpath up to the base.
|
|
|
|
|
"-rpath",
|
|
|
|
|
"@loader_path/../../../../../../../..",
|
|
|
|
|
|
|
|
|
|
# The handler is also in
|
|
|
|
|
# Content Shell.app/Contents/Frameworks/Content Shell Framework.framework/Helpers/
|
|
|
|
|
# so set the rpath for that too.
|
|
|
|
|
"-rpath",
|
|
|
|
|
"@loader_path/../../../../..",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
configs -= [ "//build/config/win:console" ]
|
|
|
|
|
configs += [ "//build/config/win:windowed" ]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
executable("crashpad_handler_test_extended_handler") {
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
|
"crashpad_handler_test_extended_handler.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../compat",
|
|
|
|
|
"../minidump:test_support",
|
|
|
|
|
"../tools:tool_support",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"//base",
|
|
|
|
|
"//build/win:default_exe_manifest",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
executable("crashpad_handler_com") {
|
|
|
|
|
sources = [
|
|
|
|
|
"main.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Avoid .exp, .ilk, and .lib file collisions with crashpad_handler.exe by
|
|
|
|
|
# having this target produce crashpad_handler_com.com. Don’t use this target
|
|
|
|
|
# directly. Instead, use crashpad_handler_console.
|
|
|
|
|
output_extension = "com"
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../compat",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"//base",
|
|
|
|
|
"//build/win:default_exe_manifest",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
copy("crashpad_handler_console") {
|
|
|
|
|
deps = [
|
|
|
|
|
":crashpad_handler_com",
|
|
|
|
|
]
|
|
|
|
|
sources = [
|
|
|
|
|
"$root_out_dir/crashpad_handler_com.com",
|
|
|
|
|
]
|
|
|
|
|
outputs = [
|
|
|
|
|
"$root_out_dir/crashpad_handler.com",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|