mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-14 01:08:01 +08:00
gn: add templates for executables and loadable_modules
When building in chromium, executables and loadable_modules should depend on: //build/config:exe_and_shlib_deps which, among other things, may be needed to introduce a dependency on a custom libc++. Bug: crashpad:30 Change-Id: Ic46a3cf5b46bdac09cca22950f9236e0776ba44a Reviewed-on: https://chromium-review.googlesource.com/974713 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
6d4626090d
commit
9c89cd99f3
@ -60,3 +60,45 @@ if (crashpad_is_in_chromium) {
|
|||||||
|
|
||||||
crashpad_is_clang = mini_chromium_is_clang
|
crashpad_is_clang = mini_chromium_is_clang
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template("crashpad_executable") {
|
||||||
|
executable(target_name) {
|
||||||
|
forward_variables_from(invoker, "*", [ "configs", "remove_configs" ])
|
||||||
|
if (defined(invoker.remove_configs)) {
|
||||||
|
configs -= invoker.remove_configs
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined(invoker.configs)) {
|
||||||
|
configs += invoker.configs
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined(deps)) {
|
||||||
|
deps = []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (crashpad_is_in_chromium) {
|
||||||
|
deps += [ "//build/config:exe_and_shlib_deps" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template("crashpad_loadable_module") {
|
||||||
|
loadable_module(target_name) {
|
||||||
|
forward_variables_from(invoker, "*", [ "configs", "remove_configs" ])
|
||||||
|
if (defined(invoker.remove_configs)) {
|
||||||
|
configs -= invoker.remove_configs
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined(invoker.configs)) {
|
||||||
|
configs += invoker.configs
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined(deps)) {
|
||||||
|
deps = []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (crashpad_is_in_chromium) {
|
||||||
|
deps += [ "//build/config:exe_and_shlib_deps" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -115,7 +115,7 @@ source_set("handler_test") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_handler") {
|
crashpad_executable("crashpad_handler") {
|
||||||
sources = [
|
sources = [
|
||||||
"main.cc",
|
"main.cc",
|
||||||
]
|
]
|
||||||
@ -147,18 +147,18 @@ executable("crashpad_handler") {
|
|||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
if (crashpad_is_in_chromium) {
|
if (crashpad_is_in_chromium) {
|
||||||
configs -= [ "//build/config/win:console" ]
|
remove_configs = [ "//build/config/win:console" ]
|
||||||
configs += [ "//build/config/win:windowed" ]
|
configs = [ "//build/config/win:windowed" ]
|
||||||
} else {
|
} else {
|
||||||
configs -=
|
remove_configs =
|
||||||
[ "//third_party/mini_chromium/mini_chromium/build:win_console" ]
|
[ "//third_party/mini_chromium/mini_chromium/build:win_console" ]
|
||||||
configs +=
|
configs =
|
||||||
[ "//third_party/mini_chromium/mini_chromium/build:win_windowed" ]
|
[ "//third_party/mini_chromium/mini_chromium/build:win_windowed" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_handler_test_extended_handler") {
|
crashpad_executable("crashpad_handler_test_extended_handler") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -176,7 +176,7 @@ executable("crashpad_handler_test_extended_handler") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
executable("crashpad_handler_com") {
|
crashpad_executable("crashpad_handler_com") {
|
||||||
sources = [
|
sources = [
|
||||||
"main.cc",
|
"main.cc",
|
||||||
]
|
]
|
||||||
@ -206,7 +206,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crash_other_program") {
|
crashpad_executable("crash_other_program") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -221,7 +221,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashy_program") {
|
crashpad_executable("crashy_program") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -234,7 +234,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashy_signal") {
|
crashpad_executable("crashy_signal") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -249,7 +249,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("fake_handler_that_crashes_at_startup") {
|
crashpad_executable("fake_handler_that_crashes_at_startup") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -257,7 +257,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("hanging_program") {
|
crashpad_executable("hanging_program") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -270,7 +270,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
loadable_module("loader_lock_dll") {
|
crashpad_loadable_module("loader_lock_dll") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -278,7 +278,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("self_destroying_program") {
|
crashpad_executable("self_destroying_program") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
@ -295,7 +295,7 @@ if (crashpad_is_win) {
|
|||||||
|
|
||||||
if (current_cpu == "x86") {
|
if (current_cpu == "x86") {
|
||||||
# Cannot create an x64 DLL with embedded debug info.
|
# Cannot create an x64 DLL with embedded debug info.
|
||||||
executable("crashy_z7_loader") {
|
crashpad_executable("crashy_z7_loader") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
@ -401,7 +401,7 @@ source_set("snapshot_test") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadable_module("crashpad_snapshot_test_module") {
|
crashpad_loadable_module("crashpad_snapshot_test_module") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"crashpad_info_client_options_test_module.cc",
|
"crashpad_info_client_options_test_module.cc",
|
||||||
@ -412,7 +412,7 @@ loadable_module("crashpad_snapshot_test_module") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
loadable_module("crashpad_snapshot_test_module_large") {
|
crashpad_loadable_module("crashpad_snapshot_test_module_large") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"crashpad_info_size_test_module.cc",
|
"crashpad_info_size_test_module.cc",
|
||||||
@ -428,7 +428,7 @@ loadable_module("crashpad_snapshot_test_module_large") {
|
|||||||
deps += [ "../third_party/mini_chromium:base" ]
|
deps += [ "../third_party/mini_chromium:base" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
loadable_module("crashpad_snapshot_test_module_small") {
|
crashpad_loadable_module("crashpad_snapshot_test_module_small") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"crashpad_info_size_test_module.cc",
|
"crashpad_info_size_test_module.cc",
|
||||||
@ -445,7 +445,7 @@ loadable_module("crashpad_snapshot_test_module_small") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
||||||
loadable_module("crashpad_snapshot_test_both_dt_hash_styles") {
|
crashpad_loadable_module("crashpad_snapshot_test_both_dt_hash_styles") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"hash_types_test.cc",
|
"hash_types_test.cc",
|
||||||
@ -457,14 +457,14 @@ if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_mac) {
|
if (crashpad_is_mac) {
|
||||||
loadable_module("crashpad_snapshot_test_module_crashy_initializer") {
|
crashpad_loadable_module("crashpad_snapshot_test_module_crashy_initializer") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc",
|
"mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_snapshot_test_no_op") {
|
crashpad_executable("crashpad_snapshot_test_no_op") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"mac/mach_o_image_annotations_reader_test_no_op.cc",
|
"mac/mach_o_image_annotations_reader_test_no_op.cc",
|
||||||
@ -473,7 +473,7 @@ if (crashpad_is_mac) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
executable("crashpad_snapshot_test_annotations") {
|
crashpad_executable("crashpad_snapshot_test_annotations") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_annotations.cc",
|
"win/crashpad_snapshot_test_annotations.cc",
|
||||||
@ -485,7 +485,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_snapshot_test_crashing_child") {
|
crashpad_executable("crashpad_snapshot_test_crashing_child") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_crashing_child.cc",
|
"win/crashpad_snapshot_test_crashing_child.cc",
|
||||||
@ -498,7 +498,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_snapshot_test_dump_without_crashing") {
|
crashpad_executable("crashpad_snapshot_test_dump_without_crashing") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_dump_without_crashing.cc",
|
"win/crashpad_snapshot_test_dump_without_crashing.cc",
|
||||||
@ -511,7 +511,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_snapshot_test_extra_memory_ranges") {
|
crashpad_executable("crashpad_snapshot_test_extra_memory_ranges") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_extra_memory_ranges.cc",
|
"win/crashpad_snapshot_test_extra_memory_ranges.cc",
|
||||||
@ -523,7 +523,7 @@ if (crashpad_is_win) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_snapshot_test_image_reader") {
|
crashpad_executable("crashpad_snapshot_test_image_reader") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_image_reader.cc",
|
"win/crashpad_snapshot_test_image_reader.cc",
|
||||||
@ -544,7 +544,7 @@ if (crashpad_is_win) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadable_module("crashpad_snapshot_test_image_reader_module") {
|
crashpad_loadable_module("crashpad_snapshot_test_image_reader_module") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/crashpad_snapshot_test_image_reader_module.cc",
|
"win/crashpad_snapshot_test_image_reader_module.cc",
|
||||||
|
@ -171,7 +171,7 @@ source_set("test_test") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_test_test_multiprocess_exec_test_child") {
|
crashpad_executable("crashpad_test_test_multiprocess_exec_test_child") {
|
||||||
sources = [
|
sources = [
|
||||||
"multiprocess_exec_test_child.cc",
|
"multiprocess_exec_test_child.cc",
|
||||||
]
|
]
|
||||||
|
@ -27,7 +27,7 @@ source_set("tool_support") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_database_util") {
|
crashpad_executable("crashpad_database_util") {
|
||||||
sources = [
|
sources = [
|
||||||
"crashpad_database_util.cc",
|
"crashpad_database_util.cc",
|
||||||
]
|
]
|
||||||
@ -42,7 +42,7 @@ executable("crashpad_database_util") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_http_upload") {
|
crashpad_executable("crashpad_http_upload") {
|
||||||
sources = [
|
sources = [
|
||||||
"crashpad_http_upload.cc",
|
"crashpad_http_upload.cc",
|
||||||
]
|
]
|
||||||
@ -56,7 +56,7 @@ executable("crashpad_http_upload") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("generate_dump") {
|
crashpad_executable("generate_dump") {
|
||||||
sources = [
|
sources = [
|
||||||
"generate_dump.cc",
|
"generate_dump.cc",
|
||||||
]
|
]
|
||||||
@ -92,7 +92,7 @@ executable("generate_dump") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_mac) {
|
if (crashpad_is_mac) {
|
||||||
executable("catch_exception_tool") {
|
crashpad_executable("catch_exception_tool") {
|
||||||
sources = [
|
sources = [
|
||||||
"mac/catch_exception_tool.cc",
|
"mac/catch_exception_tool.cc",
|
||||||
]
|
]
|
||||||
@ -105,7 +105,7 @@ if (crashpad_is_mac) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("exception_port_tool") {
|
crashpad_executable("exception_port_tool") {
|
||||||
sources = [
|
sources = [
|
||||||
"mac/exception_port_tool.cc",
|
"mac/exception_port_tool.cc",
|
||||||
]
|
]
|
||||||
@ -130,7 +130,7 @@ if (crashpad_is_mac) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("on_demand_service_tool") {
|
crashpad_executable("on_demand_service_tool") {
|
||||||
sources = [
|
sources = [
|
||||||
"mac/on_demand_service_tool.mm",
|
"mac/on_demand_service_tool.mm",
|
||||||
]
|
]
|
||||||
@ -148,7 +148,7 @@ if (crashpad_is_mac) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("run_with_crashpad") {
|
crashpad_executable("run_with_crashpad") {
|
||||||
sources = [
|
sources = [
|
||||||
"mac/run_with_crashpad.cc",
|
"mac/run_with_crashpad.cc",
|
||||||
]
|
]
|
||||||
|
@ -617,14 +617,14 @@ source_set("util_test") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
executable("crashpad_util_test_process_info_test_child") {
|
crashpad_executable("crashpad_util_test_process_info_test_child") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/process_info_test_child.cc",
|
"win/process_info_test_child.cc",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
executable("crashpad_util_test_safe_terminate_process_test_child") {
|
crashpad_executable("crashpad_util_test_safe_terminate_process_test_child") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
"win/safe_terminate_process_test_child.cc",
|
"win/safe_terminate_process_test_child.cc",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user