diff --git a/build/crashpad_buildconfig.gni b/build/crashpad_buildconfig.gni index 51b99c3b..7244afa3 100644 --- a/build/crashpad_buildconfig.gni +++ b/build/crashpad_buildconfig.gni @@ -34,6 +34,29 @@ crashpad_is_in_dart = crashpad_dependencies == "dart" crashpad_is_external = crashpad_dependencies == "external" crashpad_is_standalone = crashpad_dependencies == "standalone" +# This is the parent directory that contains the mini_chromium source dir. +# This variable is not used when crashpad_is_in_chromium. +if (crashpad_is_external || crashpad_is_in_dart) { + # External and Dart SDK builds assume crashpad and mini_chromium are peers. + mini_chromium_source_parent = "../mini_chromium" +} else if (crashpad_is_in_fuchsia) { + mini_chromium_source_parent = "../third_party/mini_chromium" +} else { + mini_chromium_source_parent = "../third_party/mini_chromium" +} + +# This is the source directory of mini_chromium (what is checked out). +_mini_chromium_source_root = "$mini_chromium_source_parent/mini_chromium" + +# This references the mini_chromium location for importing GN files. +if (crashpad_is_external || crashpad_is_in_dart) { + mini_chromium_import_root = "../../$_mini_chromium_source_root" +} else if (crashpad_is_in_fuchsia) { + mini_chromium_import_root = _mini_chromium_source_root +} else { + mini_chromium_import_root = _mini_chromium_source_root +} + if (crashpad_is_in_chromium) { crashpad_is_mac = is_mac crashpad_is_ios = is_ios @@ -46,16 +69,8 @@ if (crashpad_is_in_chromium) { crashpad_is_clang = is_clang } else { - # External and Dart SDK builds assume crashpad and mini_chromium are peers. - if (crashpad_is_external || crashpad_is_in_dart) { - 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. - import("../third_party/mini_chromium/mini_chromium/build/compiler.gni") - import("../third_party/mini_chromium/mini_chromium/build/platform.gni") - } + import("$mini_chromium_import_root/build/compiler.gni") + crashpad_is_mac = mini_chromium_is_mac crashpad_is_ios = mini_chromium_is_ios crashpad_is_win = mini_chromium_is_win diff --git a/client/BUILD.gn b/client/BUILD.gn index a53ac468..5cf5532e 100644 --- a/client/BUILD.gn +++ b/client/BUILD.gn @@ -66,13 +66,13 @@ crashpad_static_library("client") { public_deps = [ ":common", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] deps = [ ":common", - "../third_party/mini_chromium:chromeos_buildflags", + "$mini_chromium_source_parent:chromeos_buildflags", ] if (crashpad_is_win) { @@ -132,7 +132,7 @@ static_library("common") { public_configs = [ "..:crashpad_config" ] public_deps = [ - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] deps = [ "../util" ] @@ -181,7 +181,7 @@ source_set("client_test") { "../test", "../third_party/googletest:googlemock", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] diff --git a/compat/BUILD.gn b/compat/BUILD.gn index 91c437d0..8d76325d 100644 --- a/compat/BUILD.gn +++ b/compat/BUILD.gn @@ -145,7 +145,7 @@ compat_target("compat") { ] if (!crashpad_is_win) { - public_deps = [ "../third_party/mini_chromium:base" ] + public_deps = [ "$mini_chromium_source_parent:base" ] } deps = [ "../util:no_cfi_icall" ] diff --git a/minidump/BUILD.gn b/minidump/BUILD.gn index 459fd6b7..515ec0f3 100644 --- a/minidump/BUILD.gn +++ b/minidump/BUILD.gn @@ -75,7 +75,7 @@ crashpad_static_library("minidump") { deps = [ "../snapshot", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -101,7 +101,7 @@ static_library("format") { deps = [ "../snapshot:context", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -136,7 +136,7 @@ static_library("test_support") { "../snapshot:test_support", "../test", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -179,7 +179,7 @@ source_set("minidump_test") { "../snapshot:test_support", "../test", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index 2d613b6f..8b26e14a 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -247,7 +247,7 @@ crashpad_static_library("snapshot") { "../client:common", "../compat", "../minidump:format", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -269,7 +269,7 @@ static_library("context") { public_configs = [ "..:crashpad_config" ] deps = [ - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -284,7 +284,7 @@ if (crashpad_is_linux) { deps = [ ":snapshot", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util:util", ] seed_corpus = "elf/elf_image_reader_fuzzer_corpus" @@ -319,7 +319,7 @@ static_library("test_support") { deps = [ "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -435,7 +435,7 @@ source_set("snapshot_test") { "../test", "../third_party/googletest:googlemock", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -490,7 +490,7 @@ crashpad_loadable_module("crashpad_snapshot_test_module") { sources = [ "crashpad_info_client_options_test_module.cc" ] deps = [ "../client", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", ] } @@ -505,7 +505,7 @@ crashpad_loadable_module("crashpad_snapshot_test_module_large") { } defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_LARGE" ] - deps += [ "../third_party/mini_chromium:base" ] + deps += [ "$mini_chromium_source_parent:base" ] } crashpad_loadable_module("crashpad_snapshot_test_module_small") { @@ -519,7 +519,7 @@ crashpad_loadable_module("crashpad_snapshot_test_module_small") { } defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_SMALL" ] - deps += [ "../third_party/mini_chromium:base" ] + deps += [ "$mini_chromium_source_parent:base" ] } if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) && @@ -554,7 +554,7 @@ if (crashpad_is_win) { deps = [ "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", ] } @@ -564,7 +564,7 @@ if (crashpad_is_win) { deps = [ "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -575,7 +575,7 @@ if (crashpad_is_win) { deps = [ "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -586,7 +586,7 @@ if (crashpad_is_win) { deps = [ "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", ] } @@ -596,7 +596,7 @@ if (crashpad_is_win) { deps = [ "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] if (crashpad_is_in_chromium) { @@ -614,7 +614,7 @@ if (crashpad_is_win) { sources = [ "win/crashpad_snapshot_test_image_reader_module.cc" ] deps = [ "../client", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", ] if (crashpad_is_in_chromium) { if (symbol_level == 0) { diff --git a/test/BUILD.gn b/test/BUILD.gn index 93485740..dfc84d16 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -124,7 +124,7 @@ static_library("test") { deps = [ "../compat", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -204,7 +204,7 @@ source_set("test_test") { "../compat", "../third_party/googletest:googlemock", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -219,7 +219,7 @@ if (!crashpad_is_ios) { crashpad_executable("crashpad_test_test_multiprocess_exec_test_child") { sources = [ "multiprocess_exec_test_child.cc" ] - deps = [ "../third_party/mini_chromium:base" ] + deps = [ "$mini_chromium_source_parent:base" ] } } @@ -232,8 +232,8 @@ static_library("googlemock_main") { ":test", "../third_party/googletest:googlemock", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", - "../third_party/mini_chromium:base_test_support", + "$mini_chromium_source_parent:base", + "$mini_chromium_source_parent:base_test_support", ] if (crashpad_is_android) { deps += [ "../util" ] @@ -251,8 +251,8 @@ static_library("googletest_main") { deps = [ ":test", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", - "../third_party/mini_chromium:base_test_support", + "$mini_chromium_source_parent:base", + "$mini_chromium_source_parent:base_test_support", ] if (crashpad_is_android) { deps += [ "../util" ] diff --git a/test/ios/BUILD.gn b/test/ios/BUILD.gn index 59dd35d5..4ba4ec4f 100644 --- a/test/ios/BUILD.gn +++ b/test/ios/BUILD.gn @@ -41,7 +41,7 @@ source_set("google_test_runner") { "../../build:ios_enable_arc", "../../build:ios_xctest", "../../test/ios:google_test_runner_shared_headers", - "../../third_party/mini_chromium:base", + "../$mini_chromium_source_parent:base", ] frameworks = [ "UIKit.framework" ] } @@ -57,7 +57,7 @@ source_set("google_test_setup") { ":google_test_runner_shared_headers", "../../build:ios_enable_arc", "../../third_party/googletest:googletest", - "../../third_party/mini_chromium:base", + "../$mini_chromium_source_parent:base", ] frameworks = [ "UIKit.framework" ] } diff --git a/third_party/mini_chromium/BUILD.gn b/third_party/mini_chromium/BUILD.gn index c1eb5885..26661113 100644 --- a/third_party/mini_chromium/BUILD.gn +++ b/third_party/mini_chromium/BUILD.gn @@ -17,7 +17,9 @@ import("../../build/crashpad_buildconfig.gni") group("base") { if (crashpad_is_in_chromium) { public_deps = [ "//base" ] - } else if (crashpad_is_standalone || crashpad_is_in_fuchsia) { + } else if (crashpad_is_standalone) { + public_deps = [ "mini_chromium/base" ] + } else if (crashpad_is_in_fuchsia) { public_deps = [ "mini_chromium/base" ] } else if (crashpad_is_external) { public_deps = [ "../../../../mini_chromium/mini_chromium/base" ] diff --git a/tools/BUILD.gn b/tools/BUILD.gn index 7da109bc..91e20a03 100644 --- a/tools/BUILD.gn +++ b/tools/BUILD.gn @@ -22,7 +22,7 @@ source_set("tool_support") { public_configs = [ "..:crashpad_config" ] - deps = [ "../third_party/mini_chromium:base" ] + deps = [ "$mini_chromium_source_parent:base" ] } if (!crashpad_is_ios) { @@ -34,7 +34,7 @@ if (!crashpad_is_ios) { "../build:default_exe_manifest_win", "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -46,7 +46,7 @@ if (!crashpad_is_ios) { ":tool_support", "../build:default_exe_manifest_win", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -57,7 +57,7 @@ crashpad_executable("base94_encoder") { deps = [ ":tool_support", "../build:default_exe_manifest_win", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -72,7 +72,7 @@ if (!crashpad_is_fuchsia && !crashpad_is_ios) { "../compat", "../minidump", "../snapshot", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] @@ -104,7 +104,7 @@ if (crashpad_is_mac || crashpad_is_fuchsia) { ":tool_support", "../client", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -117,7 +117,7 @@ if (crashpad_is_mac) { deps = [ ":tool_support", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -138,7 +138,7 @@ if (crashpad_is_mac) { deps = [ ":tool_support", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } @@ -154,7 +154,7 @@ if (crashpad_is_mac) { deps = [ ":tool_support", "../compat", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../util", ] } diff --git a/util/BUILD.gn b/util/BUILD.gn index d9a33a22..dfb1a9a0 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -22,10 +22,8 @@ if (crashpad_is_in_chromium) { if (crashpad_is_mac || crashpad_is_ios) { if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { import("//build/config/sysroot.gni") - } else if (crashpad_is_external) { - import("../../../mini_chromium/mini_chromium/build/sysroot.gni") } else { - import("//third_party/mini_chromium/mini_chromium/build/sysroot.gni") + import("$mini_chromium_import_root/build/sysroot.gni") } action_foreach("mig") { @@ -610,8 +608,8 @@ crashpad_static_library("util") { ] deps += [ - "../third_party/mini_chromium:base", - "../third_party/mini_chromium:chromeos_buildflags", + "$mini_chromium_source_parent:base", + "$mini_chromium_source_parent:chromeos_buildflags", ] if (crashpad_is_mac || crashpad_is_ios) { @@ -664,11 +662,12 @@ if (!crashpad_is_android && !crashpad_is_ios) { deps = [ ":util", "../third_party/cpp-httplib", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../third_party/zlib", "../tools:tool_support", ] + # TODO(b/189353575): make these relocatable using $mini_chromium_ variables if (crashpad_is_standalone) { remove_configs = [ "//third_party/mini_chromium/mini_chromium/build/config:Wexit_time_destructors" ] } else if (crashpad_is_external) { @@ -699,7 +698,7 @@ if (!crashpad_is_android && !crashpad_is_ios) { source_set("no_cfi_icall") { sources = [ "misc/no_cfi_icall.h" ] public_configs = [ "..:crashpad_config" ] - public_deps = [ "../third_party/mini_chromium:build" ] + public_deps = [ "$mini_chromium_source_parent:build" ] } source_set("util_test") { @@ -876,7 +875,7 @@ source_set("util_test") { "../test", "../third_party/googletest:googlemock", "../third_party/googletest:googletest", - "../third_party/mini_chromium:base", + "$mini_chromium_source_parent:base", "../third_party/zlib", ]