From e7b447e5b9b3932d57d6839ff17d430e0ed967c1 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 27 Aug 2021 16:31:01 -0700 Subject: [PATCH] organize snapshot/BUILD.gn targets and fix create_arm_gen_snapshot (#28345) --- BUILD.gn | 5 +---- lib/snapshot/BUILD.gn | 13 ++++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f7f861a7e4a3e..e84bece9519de 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -76,10 +76,7 @@ group("flutter") { # If enbaled, compile the SDK / snapshot. if (!is_fuchsia) { - public_deps += [ - "//flutter/lib/snapshot:generate_snapshot_bin", - "//flutter/lib/snapshot:kernel_platform_files", - ] + public_deps += [ "//flutter/lib/snapshot:generate_snapshot_bins" ] if (_build_engine_artifacts) { public_deps += [ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 59d02e2631f64..825beee8127b9 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -8,6 +8,16 @@ import("//flutter/common/config.gni") import("//flutter/lib/ui/dart_ui.gni") import("//third_party/dart/utils/compile_platform.gni") +group("generate_snapshot_bins") { + deps = [ + ":generate_snapshot_bin", + ":kernel_platform_files", + ] + if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { + deps += [ ":create_arm_gen_snapshot" ] + } +} + compiled_action("generate_snapshot_bin") { if (target_cpu == "x86" && host_os == "linux") { # By default Dart will create a 32-bit gen_snapshot host binary if the target @@ -221,9 +231,6 @@ source_set("snapshot") { ":vm_snapshot_data_linkable", ":vm_snapshot_instructions_linkable", ] - if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { - deps += [ ":create_arm_gen_snapshot" ] - } sources = get_target_outputs(":isolate_snapshot_data_linkable") + get_target_outputs(":isolate_snapshot_instructions_linkable") +