From 296501351816448182af26c5f51c41e1a0ff7bea Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 23 Mar 2020 14:59:21 -0400 Subject: [PATCH] Prepare crashpad mig stuff for -Wunreachable-code in chromium_code. Bug: chromium:346399 Change-Id: I5d93a2f6781dd4dd3483009d9c470050d490be3c Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2116252 Reviewed-by: Mark Mentovai Commit-Queue: Nico Weber --- util/BUILD.gn | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/util/BUILD.gn b/util/BUILD.gn index aa890264..bd0d2427 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -75,6 +75,17 @@ if (crashpad_is_mac) { rebase_path("../compat/mac", root_build_dir), ] } + + source_set("mig_output") { + deps = [ ":mig" ] + sources = get_target_outputs(":mig") + if (crashpad_is_in_chromium) { + # mig output contains unreachable code, which irks -Wunreachable-code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + } + public_configs = [ "..:crashpad_config" ] + } } static_library("util") { @@ -281,7 +292,6 @@ static_library("util") { "process/process_memory_mac.h", "synchronization/semaphore_mac.cc", ] - sources += get_target_outputs(":mig") } deps = [] @@ -483,7 +493,7 @@ static_library("util") { "IOKit.framework", ] deps += [ - ":mig", + ":mig_output", "../third_party/apple_cf:apple_cf", ] include_dirs += [ "$root_build_dir/gen" ]