Clear the gn sources_assignment_filter when building in Chromium

Chromium relies on a global gn sources assignment filter, even though
it’s kind of discouraged. Crashpad doesn’t use this, instead selecting
which files to build entirely with the logic in its .gn files. In some
cases, Chromium’s filters prevent _linux files from building on Android,
and _mac files from building on iOS, even though Crashpad’s build has
explicitly requested these inclusions. To overcome this problem,
clear the gn sources_assignment_filter in all of Crashpad’s own .gn
files when building in Chromium.

Change-Id: Iab0af29f4e5aff4be8eec2ee12b2e3f991c0a86d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2285959
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
This commit is contained in:
Mark Mentovai 2020-07-07 23:26:07 -04:00 committed by Commit Bot
parent 7cf66d83e6
commit 828095ac32
10 changed files with 43 additions and 6 deletions

View File

@ -16,6 +16,11 @@ import("build/crashpad_buildconfig.gni")
import("build/test.gni")
import("util/net/tls.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
config("crashpad_config") {
include_dirs = [ "." ]
}

View File

@ -51,8 +51,8 @@ if (crashpad_is_in_chromium) {
import("../../../mini_chromium/mini_chromium/build/compiler.gni")
import("../../../mini_chromium/mini_chromium/build/platform.gni")
} else {
# Both standalone and in Fuchsia tree use mini_chromium, and it's mapped into
# the same location in both cases.
# Both standalone and in Fuchsia tree use mini_chromium, and it's mapped
# into the same location in both cases.
import("../third_party/mini_chromium/mini_chromium/build/compiler.gni")
import("../third_party/mini_chromium/mini_chromium/build/platform.gni")
}

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
static_library("client") {
sources = [
"annotation.cc",
@ -51,7 +56,6 @@ static_library("client") {
}
if (crashpad_is_linux || crashpad_is_android) {
set_sources_assignment_filter([])
sources += [
"crashpad_client_linux.cc",
"simulate_crash_linux.h",

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
config("compat_config") {
include_dirs = []

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
static_library("handler") {
sources = [
"crash_report_upload_thread.cc",
@ -40,7 +45,6 @@ static_library("handler") {
}
if (crashpad_is_linux || crashpad_is_android) {
set_sources_assignment_filter([])
sources += [
"linux/capture_snapshot.cc",
"linux/capture_snapshot.h",
@ -169,7 +173,6 @@ if (crashpad_is_android) {
}
crashpad_executable("crashpad_handler_trampoline") {
set_sources_assignment_filter([])
output_name = "libcrashpad_handler_trampoline.so"
sources = [ "linux/handler_trampoline.cc" ]

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
static_library("minidump") {
sources = [
"minidump_annotation_writer.cc",

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
static_library("test") {
testonly = true
@ -84,7 +89,6 @@ static_library("test") {
}
if (crashpad_is_linux || crashpad_is_android) {
set_sources_assignment_filter([])
sources += [
"linux/fake_ptrace_connection.cc",
"linux/fake_ptrace_connection.h",

View File

@ -16,6 +16,9 @@ import("../../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
import("//build/config/ios/rules.gni")
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
} else if (crashpad_is_standalone) {
import("//third_party/mini_chromium/mini_chromium/build/ios/rules.gni")
}

View File

@ -16,6 +16,9 @@ import("../../../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
import("//build/config/ios/rules.gni")
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
} else if (crashpad_is_standalone) {
import("//third_party/mini_chromium/mini_chromium/build/ios/rules.gni")
}

View File

@ -14,6 +14,11 @@
import("../build/crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
# Prevent Chromium source assignment filters from being inherited.
set_sources_assignment_filter([])
}
source_set("tool_support") {
sources = [
"tool_support.cc",