mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
gn, android: Build for Android with GN
With a companion mini_chromium change at https://crrev.com/c/841203, it’s possible to configure via “gn args” as follows: android_ndk = "/android/android-ndk-r16" target_cpu = "x86_64" target_os = "android" Note that a standalone toolchain is not required. Bug: crashpad:30, crashpad:79 Change-Id: Ica55bdcb82c730909c05dd9fecb40a74eca78c8a Reviewed-on: https://chromium-review.googlesource.com/841286 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
parent
e9d2ca60f7
commit
7a285816e9
@ -21,10 +21,14 @@ config("compat_config") {
|
|||||||
include_dirs += [ "mac" ]
|
include_dirs += [ "mac" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
include_dirs += [ "linux" ]
|
include_dirs += [ "linux" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crashpad_is_android) {
|
||||||
|
include_dirs += [ "android" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
include_dirs += [ "win" ]
|
include_dirs += [ "win" ]
|
||||||
} else {
|
} else {
|
||||||
@ -61,13 +65,29 @@ compat_target("compat") {
|
|||||||
sources += [ "non_mac/mach/mach.h" ]
|
sources += [ "non_mac/mach/mach.h" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux/signal.h",
|
"linux/signal.h",
|
||||||
"linux/sys/ptrace.h",
|
"linux/sys/ptrace.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crashpad_is_android) {
|
||||||
|
sources += [
|
||||||
|
"android/elf.h",
|
||||||
|
"android/linux/elf.h",
|
||||||
|
"android/linux/prctl.h",
|
||||||
|
"android/linux/ptrace.h",
|
||||||
|
"android/sched.h",
|
||||||
|
"android/sys/epoll.cc",
|
||||||
|
"android/sys/epoll.h",
|
||||||
|
"android/sys/mman.cc",
|
||||||
|
"android/sys/mman.h",
|
||||||
|
"android/sys/syscall.h",
|
||||||
|
"android/sys/user.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
if (crashpad_is_win) {
|
if (crashpad_is_win) {
|
||||||
sources += [
|
sources += [
|
||||||
"win/getopt.h",
|
"win/getopt.h",
|
||||||
|
@ -37,7 +37,7 @@ static_library("handler") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux/exception_handler_server.cc",
|
"linux/exception_handler_server.cc",
|
||||||
"linux/exception_handler_server.h",
|
"linux/exception_handler_server.h",
|
||||||
@ -89,7 +89,7 @@ source_set("handler_test") {
|
|||||||
"minidump_to_upload_parameters_test.cc",
|
"minidump_to_upload_parameters_test.cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [ "linux/exception_handler_server_test.cc" ]
|
sources += [ "linux/exception_handler_server_test.cc" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ static_library("snapshot") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"elf/elf_dynamic_array_reader.cc",
|
"elf/elf_dynamic_array_reader.cc",
|
||||||
"elf/elf_dynamic_array_reader.h",
|
"elf/elf_dynamic_array_reader.h",
|
||||||
@ -252,7 +252,7 @@ static_library("test_support") {
|
|||||||
|
|
||||||
config("snapshot_test_link") {
|
config("snapshot_test_link") {
|
||||||
visibility = [ ":*" ]
|
visibility = [ ":*" ]
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
# There’s no way to make the link depend on this file. “inputs” doesn’t have
|
# There’s no way to make the link depend on this file. “inputs” doesn’t have
|
||||||
# the intended effect in a config. https://crbug.com/781858,
|
# the intended effect in a config. https://crbug.com/781858,
|
||||||
# https://crbug.com/796187.
|
# https://crbug.com/796187.
|
||||||
@ -283,7 +283,7 @@ source_set("snapshot_test") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"elf/elf_image_reader_test.cc",
|
"elf/elf_image_reader_test.cc",
|
||||||
"elf/elf_image_reader_test_note.S",
|
"elf/elf_image_reader_test_note.S",
|
||||||
@ -345,7 +345,7 @@ source_set("snapshot_test") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
libs = [ "dl" ]
|
libs = [ "dl" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ static_library("test") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux/fake_ptrace_connection.cc",
|
"linux/fake_ptrace_connection.cc",
|
||||||
"linux/fake_ptrace_connection.h",
|
"linux/fake_ptrace_connection.h",
|
||||||
|
20
third_party/gtest/BUILD.gn
vendored
20
third_party/gtest/BUILD.gn
vendored
@ -90,9 +90,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
]
|
]
|
||||||
sources -= [ "gtest/googletest/src/gtest-all.cc" ]
|
sources -= [ "gtest/googletest/src/gtest-all.cc" ]
|
||||||
public_configs = [ ":gtest_public_config" ]
|
public_configs = [ ":gtest_public_config" ]
|
||||||
configs -= [
|
configs -= [ "//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors" ]
|
||||||
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
|
|
||||||
]
|
|
||||||
configs += [ ":gtest_private_config" ]
|
configs += [ ":gtest_private_config" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,9 +127,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
"gtest/googletest/test/production.cc",
|
"gtest/googletest/test/production.cc",
|
||||||
"gtest/googletest/test/production.h",
|
"gtest/googletest/test/production.h",
|
||||||
]
|
]
|
||||||
configs -= [
|
configs -= [ "//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors" ]
|
||||||
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
|
|
||||||
]
|
|
||||||
configs += [ ":gtest_private_config" ]
|
configs += [ ":gtest_private_config" ]
|
||||||
deps = [
|
deps = [
|
||||||
":gtest",
|
":gtest",
|
||||||
@ -173,9 +169,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
"gtest/googletest/test/gtest-param-test_test.cc",
|
"gtest/googletest/test/gtest-param-test_test.cc",
|
||||||
"gtest/googletest/test/gtest-param-test_test.h",
|
"gtest/googletest/test/gtest-param-test_test.h",
|
||||||
]
|
]
|
||||||
configs -= [
|
configs -= [ "//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors" ]
|
||||||
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
|
|
||||||
]
|
|
||||||
configs += [ ":gtest_private_config" ]
|
configs += [ ":gtest_private_config" ]
|
||||||
deps = [
|
deps = [
|
||||||
":gtest",
|
":gtest",
|
||||||
@ -303,9 +297,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
]
|
]
|
||||||
sources -= [ "gtest/googlemock/src/gmock-all.cc" ]
|
sources -= [ "gtest/googlemock/src/gmock-all.cc" ]
|
||||||
public_configs = [ ":gmock_public_config" ]
|
public_configs = [ ":gmock_public_config" ]
|
||||||
configs -= [
|
configs -= [ "//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors" ]
|
||||||
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
|
|
||||||
]
|
|
||||||
configs += [ ":gmock_private_config" ]
|
configs += [ ":gmock_private_config" ]
|
||||||
deps = [
|
deps = [
|
||||||
":gtest",
|
":gtest",
|
||||||
@ -378,9 +370,7 @@ if (crashpad_is_in_chromium) {
|
|||||||
sources = [
|
sources = [
|
||||||
"gtest/googlemock/test/gmock_stress_test.cc",
|
"gtest/googlemock/test/gmock_stress_test.cc",
|
||||||
]
|
]
|
||||||
configs -= [
|
configs -= [ "//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors" ]
|
||||||
"//third_party/mini_chromium/mini_chromium/build:Wexit_time_destructors",
|
|
||||||
]
|
|
||||||
configs += [ ":gmock_private_config" ]
|
configs += [ ":gmock_private_config" ]
|
||||||
deps = [
|
deps = [
|
||||||
":gmock",
|
":gmock",
|
||||||
|
@ -241,6 +241,10 @@ static_library("util") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux) {
|
||||||
|
sources += [ "net/http_transport_libcurl.cc" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux/address_types.h",
|
"linux/address_types.h",
|
||||||
"linux/auxiliary_vector.cc",
|
"linux/auxiliary_vector.cc",
|
||||||
@ -269,7 +273,6 @@ static_library("util") {
|
|||||||
"linux/thread_info.h",
|
"linux/thread_info.h",
|
||||||
"linux/traits.h",
|
"linux/traits.h",
|
||||||
"misc/paths_linux.cc",
|
"misc/paths_linux.cc",
|
||||||
"net/http_transport_libcurl.cc",
|
|
||||||
"posix/process_info_linux.cc",
|
"posix/process_info_linux.cc",
|
||||||
"process/process_memory_linux.cc",
|
"process/process_memory_linux.cc",
|
||||||
"process/process_memory_linux.h",
|
"process/process_memory_linux.h",
|
||||||
@ -450,11 +453,16 @@ source_set("util_test") {
|
|||||||
"thread/worker_thread_test.cc",
|
"thread/worker_thread_test.cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!crashpad_is_fuchsia) {
|
if (!crashpad_is_android && !crashpad_is_fuchsia) {
|
||||||
# TODO(scottmg): This requires an implementation of MultiprocessExec for
|
# Android and Fuchsia will each require an HTTPTransport implementation
|
||||||
# testing, and a solution to http_transport_test_server.py -- either a port
|
# (libcurl isn’t in either’s SDK) and a solution to
|
||||||
# to non-Python, or method of forwarding those requests back to the builder
|
# http_transport_test_server.py, because Python isn’t available on either.
|
||||||
|
# The latter could be ported to non-Python, or the test server could run on
|
||||||
|
# the build host with a method to forward requests from the device to the
|
||||||
# host.
|
# host.
|
||||||
|
#
|
||||||
|
# TODO(scottmg): Fuchsia will also require an implementation of
|
||||||
|
# MultiprocessExec for testing.
|
||||||
sources += [ "net/http_transport_test.cc" ]
|
sources += [ "net/http_transport_test.cc" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,7 +501,7 @@ source_set("util_test") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crashpad_is_linux) {
|
if (crashpad_is_linux || crashpad_is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux/auxiliary_vector_test.cc",
|
"linux/auxiliary_vector_test.cc",
|
||||||
"linux/memory_map_test.cc",
|
"linux/memory_map_test.cc",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user