From 2af0c7b91044f6d0d350965774745e2ecefb848c Mon Sep 17 00:00:00 2001 From: David Worsham Date: Thu, 13 Aug 2020 11:58:46 -0700 Subject: [PATCH] Fix unoptimized fuchsia builds --- shell/platform/fuchsia/flutter/BUILD.gn | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index 1fb72821b4e4a..87415a33d8ec3 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/shell/platform/fuchsia/flutter/BUILD.gn @@ -21,12 +21,30 @@ shell_gpu_configuration("fuchsia_legacy_gpu_configuration") { enable_metal = false } +config("runner_debug_config") { + defines = [ "DEBUG" ] # Needed due to direct dart dependencies. +} + +config("runner_flutter_profile_config") { + defines = [ "FLUTTER_PROFILE" ] +} + +config("runner_product_config") { + defines = [ "DART_PRODUCT" ] +} + template("runner_sources") { assert(defined(invoker.product), "runner_sources must define product") - extra_defines = [] + runner_configs = [] + if (is_debug) { + runner_configs += [ ":runner_debug_config" ] + } + if (flutter_runtime_mode == "profile") { + runner_configs += [ ":runner_flutter_profile_config" ] + } if (invoker.product) { - extra_defines += [ "DART_PRODUCT" ] + runner_configs += [ ":runner_product_config" ] } source_set(target_name) { @@ -75,10 +93,7 @@ template("runner_sources") { "vulkan_surface_producer.h", ] - defines = extra_defines - if (flutter_runtime_mode == "profile") { - defines += [ "FLUTTER_PROFILE" ] - } + public_configs = runner_configs # The use of these dependencies is temporary and will be moved behind the # embedder API. @@ -168,9 +183,6 @@ template("flutter_runner") { if (invoker.product) { product_suffix = "_product" } - if (is_debug) { - extra_defines += [ "DEBUG" ] # Needed due to direct dart dependencies. - } executable(target_name) { output_name = invoker_output_name